Exploring, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

SAS Visual Analytics: Let user choose multiple variables displayed to graph

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 7
Accepted Solution

SAS Visual Analytics: Let user choose multiple variables displayed to graph

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.


Accepted Solutions
Solution
‎06-29-2018 03:47 AM
PROC Star
Posts: 398

Re: SAS Visual Analytics: Let user choose multiple variables displayed to graph

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 Smiley Happy

 

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


All Replies
Solution
‎06-29-2018 03:47 AM
PROC Star
Posts: 398

Re: SAS Visual Analytics: Let user choose multiple variables displayed to graph

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 Smiley Happy

 

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

Occasional Contributor
Posts: 7

Re: SAS Visual Analytics: Let user choose multiple variables displayed to graph

This worked! Thank you very much Fredrik!

- Laine
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 127 views
  • 1 like
  • 2 in conversation