BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Laine
Fluorite | Level 6

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.

1 ACCEPTED SOLUTION

Accepted Solutions
FredrikE
Rhodochrosite | Level 12

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

View solution in original post

2 REPLIES 2
FredrikE
Rhodochrosite | Level 12

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

Laine
Fluorite | Level 6
This worked! Thank you very much Fredrik!

- Laine

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Tips for filtering data sources in SAS Visual Analytics

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.

Discussion stats
  • 2 replies
  • 1488 views
  • 2 likes
  • 2 in conversation