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

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

1 ACCEPTED SOLUTION

Accepted Solutions
shudsoo
Calcite | Level 5

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...

Filter_Prompt.jpg

View solution in original post

6 REPLIES 6
art297
Opal | Level 21

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.

shudsoo
Calcite | Level 5

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

ChrisHemedinger
Community Manager

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

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
shudsoo
Calcite | Level 5

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

shudsoo
Calcite | Level 5

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...

Filter_Prompt.jpg

DavidPhillips2
Rhodochrosite | Level 12

How do you load up query builder after selecting a data source?

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 9435 views
  • 0 likes
  • 4 in conversation