I'm wondering if there is anyway to do a calculation by specific groups within the same column of data.
If I have the following data set, I want to be able to sum the Count column by Status then divide the sum of sold status count by the sum of proposed status count. Is this possible is VA?
I know I can manipulate the data prior to bring it into VA and columns for 'Sold Count' and 'Proposed Count' and would be able to do the calculation that way, just curious if there is another way.
I think you need to create two calculated items one for each status and then create a calculation between them
Var 1: if status = 'sold' then count else . | Aggregation = count.
Var 2: if status = 'proposed' then count else . | Aggregation = count.
Var 3: var 1 / var 2
I have not seen any example (yet) on how to do it using just one column 🙂
View solution in original post
Ah yes, that works. Didn't think to do the counts in VA. Perfect!
Just for reference, here is the actual text that is working for me:
IF ( 'STATUS'n In ('SOLD') )RETURN 'COUNT'nELSE 0
The early bird rate has been extended! Register by March 18 for just $695 - $100 off the standard rate.
Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.