Hi. I am a new user to SAS VA 7.4. I have a field with 7 possible values A,B,C,D,E,F,G.
Each instance of UpNum can have only one of these values. There are multiple instances of the same UpNum.
I need to count the total times that A,C,E,F occur for each UpNum to be able to calculate
TOT#(ACEF) per #UpNum and use this in a bar chart or a table.
In this example: #UpNum(ACEF)(=1) for N1, (=2) for N2, etc. (I have been running into Datatype errors for the operators).
UpNum Field Value Output
N1 A N1 #(ACEF)
N1 B N2 #(ADEF)
N1 D N3..... #(ACEF)
N1 G N4.... #(ACEF)
N2 C
N2 G
N2 A
Thank you for any advice.
Ed C.
Hi. No, that is just my shorthand to describe what I am looking for. No syntax implied.
I am open to any suggestions of how to get to my output. #(ACEF) was just meant to say
that I need the sum of the counts of A, C, E, F for each UpNum value. Sorry for the confusion.
Your original question is a little bit confusing -- how many variables are we talking about in your data?
Does your data look like this?
UpNum X
N1 A
N1 C
N2 E
N2 F
If N1, N2, etc are in a separate column from the A B C D E F G values, then you could calculate something like this:
IF X in ('A', 'C', 'E', 'F')
RETURN 1
ELSE 0
Then you could make a table with just Upnum and your calculated item. Turn off detail data in the table properties.
Would that work?
Yes, in one column N1....Nn and in a separate column A-G.
This would be a new Calculated Measure? Why turn off Detail Data?
Thanks! Strategy question. Would this column be better created in the original table
or in SAS VA? (Is there a rule of thumb for this?).
This worked just right! Thanks for helping me move toward the next experience level....
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.