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

SAS Visual Analytics - Parameter use case as macro variable base SAS

Reply
Occasional Contributor
Posts: 19

SAS Visual Analytics - Parameter use case as macro variable base SAS

Dear,

 

I am working with a client and I have requirement as decsribed below

 

1. There is list of variables in the drop down list which is around 100 variables. Users will select one of the variable from this list.

2. There is a graph and list table which is populate the values of that variable. variable which is select by user in the drop down list.

 

I can easily do this by using a parameter in the list table and create calculated field using that parameter. This involves if else condition. Problem is that I have 100 of variable and list will keep on increasing. I can not have so many if else condition.  And if new variable is added because it will be not part of nested if else I will have to modiy that everytime. This is not desirable in the case of client I am working.  

 

Any solution will be helpful.

 

If  I am EG to create this report I can use a macro variable using prompt option and user can select the desired variable from that prompt list. Lets say that macro variable is Selected_Variable. lets assume user wants to see mean of Revenue/Cost/profit

 

. I will write the following program

 

Proc Means data=dataset;

var &Selected_Variable;

run;

 

Second example

 

Data test;

set dataset;

 

Target_variable=&Selected_Variable;

run;

 

 

&Selected_Variable this will resolve to variable Revenue if user selects Revenue in the prompt. Likewise for all other cases.

 

In VA if create a new calculated field and assign to that parameter. It treats as character and new field will have the value of parameter. This not having the value of parameter varibales value.

 

Any suggestion how to implement this. Please Please.....

SAS Employee
Posts: 19

Re: SAS Visual Analytics - Parameter use case as macro variable base SAS

Hello lokendra_devangan_corecompete_com,

Have you tried using parameters to create cascading prompts? By using cascading prompts, it will lessen the number of variables. Please reference the link attached below which will go into more detail about cascading prompts. Please notify me if you have any more questions regarding this issue.

 

https://communities.sas.com/t5/SAS-Visual-Analytics/Dependency-between-drop-down-list/td-p/164710

 

Best, 

Meredith Bailey 

 

 

Post a Question
Discussion Stats
  • 1 reply
  • 264 views
  • 1 like
  • 2 in conversation