07-13-2016 05:10 AM
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;
&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.....
08-11-2016 04:22 PM
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.