01-30-2018 03:40 PM
Am a new SAS VA user. I need to write function like this can you help me out. These are the measures, I need to create.
1. Count (A =' Yes')
Column A has two distinct values in it. I need to know the count of 'Yes' and use it as a Measure in chart.
2. Count( A <1 ) AND Count ( B < 1 )
How to write a condition like this & keep it as a measure.
01-30-2018 04:30 PM - edited 01-30-2018 04:31 PM
Thanks for the reply. Tried it & still getting some error. Can you give some example or something that is done previously.
01-30-2018 04:11 PM
Count is an aggregated measure so all you need to do is in the Data Pane click the down arrow and select New Aggregated Measure. In this window you can define formulas to do what you want.
01-30-2018 05:48 PM
Thanks for the reply @SASKiwi. Yes, I did it already but getting error within that. Since I am unable to write conditions within that. I can share the snapshot of it for clarity.
I need to write condition & then get the count of it.
Count( A ='Yes' )
01-31-2018 11:56 AM - edited 01-31-2018 11:58 AM
You need to create a calculated measure like this:
IF ( 'A'n = 'yes' )
The sum of that measure is what you want.
Your second condition can also be evaluated with IF statements:
IF ( ( 'A'n < 1 ) AND ( 'B'n < 1 ) )
About the Count() function, it returns the number of nonmissing values for a measure. So if your IF statements return missing instead of 0 you could use count. But it is simpler to just use sum with the expressions above.
I hope this helps,