Case When

Reply
New Contributor
Posts: 4

Case When

I am trying to add a "Case When" statement to my table with contains.  I have 2 stings that are alike and it calculates both.  How do I distinguish

 

1)  Review and Discussion

2)  Review and Discussion Client

 

Thanks

 

Super Contributor
Posts: 340

Re: Case When

Hi,

 

Can you avoid using the contains operator and use the eq (equals) operator instead for the first case?

 

 

Regards,

Amir.

 

New Contributor
Posts: 4

Re: Case When

I tried that however I am trying to count the occurrence of each time it appear.   There are approx. 40 other descriptions that in the row. 

 

Super Contributor
Posts: 340

Re: Case When

Hi,

 

I think it would be useful if you shared your code (or a sample we can run) with some data in the form of a data step with datalines that we can also run to create the data.

 

Would the count function help?:

 

http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002260230.htm

 

 

Regards,

Amir.

Valued Guide
Posts: 597

Re: Case When

Simply igore the one you don't want to count

 

Find(var,"Review and Discussion",'i')>0 and Find(var,"Review and Discussion Client",'i')=0 then Count+1;

Thanks,
Suryakiran
Ask a Question
Discussion stats
  • 4 replies
  • 97 views
  • 0 likes
  • 3 in conversation