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

Hello,

I'm trying to establish if it possible to create cascading prompts in EG 5.1 based on date range values.  Essentially I need user to pick a date range and a list will dynamically populate a drop down with a list of items.

I have seen papers discussing dependencies between two drop downs and how to dynamically populate, however, I'm not sure if it is possible with a date range.

Any suggestions or examples are greatly appreciated.

Thx,

Rob

1 ACCEPTED SOLUTION

Accepted Solutions
TimCampbell
Quartz | Level 8

Hi Rob,

It is possible using a stored process.

I tried taking an example table with one column containing dates and one with some plain text from my server.

I then create a stored process in EG and in the prompts create prompt_1 as a date range prompt,

then for prompt_2 I made it Numeric and User Selects values from a dynamic list.

I then browsed to the table with the data in and chose the date column for the unformatted data and the text column for the formatted data.

Then on the dependencies tab I added a dependency to prompt_1 so that my date column was between (inclusive) of the values in prompt 1

and the prompt populated only the text values where the date range was satisfied.

Unfortunately this may not get you all the way there as I the macro variable returned from prompt_2 will have the value of the date in the table and not the text value itself but it shouldn't be too much work to lookup the text you need using the date value in the prompt...

Generally I would do something like this by having my date range value pre-defined (or in a separate prompt) and then linking the prompt for text to a view of the data that is joined on the sashelp.vmacro table to limit to the date range i need, which means you don't need the stored process but can be trickier to get going.

Tim

View solution in original post

2 REPLIES 2
TimCampbell
Quartz | Level 8

Hi Rob,

It is possible using a stored process.

I tried taking an example table with one column containing dates and one with some plain text from my server.

I then create a stored process in EG and in the prompts create prompt_1 as a date range prompt,

then for prompt_2 I made it Numeric and User Selects values from a dynamic list.

I then browsed to the table with the data in and chose the date column for the unformatted data and the text column for the formatted data.

Then on the dependencies tab I added a dependency to prompt_1 so that my date column was between (inclusive) of the values in prompt 1

and the prompt populated only the text values where the date range was satisfied.

Unfortunately this may not get you all the way there as I the macro variable returned from prompt_2 will have the value of the date in the table and not the text value itself but it shouldn't be too much work to lookup the text you need using the date value in the prompt...

Generally I would do something like this by having my date range value pre-defined (or in a separate prompt) and then linking the prompt for text to a view of the data that is joined on the sashelp.vmacro table to limit to the date range i need, which means you don't need the stored process but can be trickier to get going.

Tim

RobK777
Calcite | Level 5

Thanks Tim.

The stored process method works brilliantly.  Again Thank You.

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
  • 2 replies
  • 1579 views
  • 0 likes
  • 2 in conversation