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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 989 views
  • 0 likes
  • 2 in conversation