Hello,
I am working with SAS Visual Analytics 7.4. I would like to know is it possible to let user to define the variables to show in a graph? I have seen solutions where parameters were used to display one measure but I want user to define the measures to be displayed.
Originally my data is like the example below. I have an ID variable, three measures and a categorical variable indicating time of measurement. I would like present these result ideally in a trellis plot where each subject would be displayed in a separate graph, but VA doesn't support this. On the X-axis I have the Time variable, on the Y-axis I would have the measurements chosen by the user. User would be able to select A, B and C or A and C or only B etc. from List object. Is this possible to implement with a line graph?
ID | A | B | C | Time
---+---+----+--+-------
A1 | 2 | 4 | 5 | After
A1 | 7 | 3 | 8 | Before
B4 | 1 | 4 | 5 | After
B4 | 5 | 3 | 8 | Before
C3 | 2 | 4 | 5 | After
C3 | 2 | 2 | 8 | Before
Don't hesitate to ask more info if needed.
Hi!
I think you can do this by using parameters and calculated measures.
As an example you can have one list box with one selection for each combination (and one parameter assigned to the list box) or one listbox for each measure (and one parameter for each measure/list box).
Your calculated measures check the value of the parameter(s) and either set the value to the original measure or to missing, something like this:
calculated measure a_calc:
IF parameter1 = 'A' then a else .
calculated measure b_calc:
IF parameter1 = 'B' then b else .
calculated measure c_calc:
IF parameter1 = 'C' then c else .
then use these calculated variables in your graph.
Might work 🙂
Another way is to transform your data and create a dimension containing the measures (a,b and c) and then stack your graph on that dimension...
//Fredrik
Hi!
I think you can do this by using parameters and calculated measures.
As an example you can have one list box with one selection for each combination (and one parameter assigned to the list box) or one listbox for each measure (and one parameter for each measure/list box).
Your calculated measures check the value of the parameter(s) and either set the value to the original measure or to missing, something like this:
calculated measure a_calc:
IF parameter1 = 'A' then a else .
calculated measure b_calc:
IF parameter1 = 'B' then b else .
calculated measure c_calc:
IF parameter1 = 'C' then c else .
then use these calculated variables in your graph.
Might work 🙂
Another way is to transform your data and create a dimension containing the measures (a,b and c) and then stack your graph on that dimension...
//Fredrik
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.