Hi all,
I need to have the ability where basic sas users on EG run a project where the user selects a range of values from a list.
I have set up the prompt in prompt manager where 'user selects values from a dynamic list' and the numebr of values is Multiple Values - the data source and column are valid.
I have then set a filter in my query builder to filter in a list, contains, matches pattern etc so that te query builder filters on the prompt where the prompt is the range of values.
This is only returning me the top value in the list - looking at the log, it appears that SAS is appending a number to the of each prompt for some reason.
So help required please - how do I set up a prompt and filter whereby the user selects from a range of values and then the filter in the query builder returns the correct records depending on the range of values selected...
Many thanks in advance
Steve
Resolved....
Prompt Manager - enter name and prompt name
User selects from non-blank values (if applicable)
Prompt Type - select Text, User selects from dynamic list and also from multiple values
Select Datasource and datasource column for values.
Then in the query builder, bring across the columns required
Select Filter
Select column to filter by
Select in a list
Add value to be the prompt from the prompt tab
Tick the checkbox - generate filter for a prompt value
Re-select the prompt into the value box again
then next, finish and run the project/job.
The filter box should look something like this...
Can't you just filter by "in a list"? That automatically brings up the list of potential values and all you have to do is add the ones you want.
Hi,
the list of potential values is contained within the prompt - I want to filter by the list of values selected by the user in the prompt when running the project.
In a list would work if I wanted the user to filter the results that way - what I want is for the user to select the values from a prompt and then the filter looks at the prompt.
Thanks
Steve
Are you looking for a way to code a filter based on the macro variables that the prompt generates?
You might need to look at the %eg_whereparam macro. See this article by Angela:
SAS Enterprise Guide Prompting Examples using %_eg_WhereParam
Chris
Hi Chris,
Thanks for this - I have looked at the link and associated videos - tried them this morning but to no avail...
What I am trying to do looks, on paper, to be extremely straight forward but as I have found with SAS - the simple tasks are the ones it struggles with!!!
I will continue my fruitless pursuit...
Rgds
S
Resolved....
Prompt Manager - enter name and prompt name
User selects from non-blank values (if applicable)
Prompt Type - select Text, User selects from dynamic list and also from multiple values
Select Datasource and datasource column for values.
Then in the query builder, bring across the columns required
Select Filter
Select column to filter by
Select in a list
Add value to be the prompt from the prompt tab
Tick the checkbox - generate filter for a prompt value
Re-select the prompt into the value box again
then next, finish and run the project/job.
The filter box should look something like this...
How do you load up query builder after selecting a data source?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.