BookmarkSubscribeRSS Feed
rahman_dipu
Calcite | Level 5

Hello!

Some background:

I am creating a report that summarizes market distribution data for various population groups either by the population's age or by chronological date. Not all population groups can be represented by both age or date, that is, certain groups can be represented by age, but not date, and vice-versa, and some groups can be represented by both. We have a database table that contains the information that lists the population groups and its possible representations. See the table drawn below for an example.

The input requirements for this report are as follows:

1. The user first chooses a population group from a drop down list

2. Then based on the specific population, the user is prompted to choose the representation (age or date - for some population one or both choices may be available)

3. If Date representation is chosen, the user is prompted for a date range and three other additional prompts (like product type, sub-type, location etc.)

4. If Age representation is chosen, the user is only prompted for the three additional prompts (like product type, sub-type, location etc.) - and *no* date range

5. User clicks Run to generate the report.

I can create a prompt that dynamically loads the populations form the database table. Then I can use the dependencies to create the prompts on the second requirement that prompts the user to choose the representation. If population_1 is chosen, the user only gets to choose Age. If population_2 is chosen, the the user get to choose either Age or Date, and so on and so forth. However, I am stuck on requirement 3. That is if the user chooses Date representation, I have not been able to figure out how to prompt for a date range based on the answer from step 2! That is, prompt for a date range only if the user chooses a date representation for populations population_2, population_3 or population_4, but leave out the date range prompt if the user chooses Age representation on a population.

Help!

Am I thinking about this incorrectly? Is this possible to accomplish this in a Stored Process using Enterprise Guide?

Sample of a table we have in the database.

POPULATION_REPRESENT

population_grouppopulation_represent_type
population_1Age
population_2Age
population_2Date
population_3Date
population_4Age
populations_4Date

Here is what I can do: I can manually group the prompts for each population. This I would like to avoid since we have over 15 different types of population groups. But really hoping to use the database tables to dynamically accomplish this!

Thanks!

1 REPLY 1
Cynthia_sas
SAS Super FREQ

Hi:

  My suggestion is that you look in the Stored Process Developer's Guide. I think that what you want is a selection prompt group.

SAS(R) 9.4 Stored Processes: Developer's Guide

where the description about selection groups says:

***** begin quote;

Use a selection group when you want the user to choose from several prompt groups. Selection groups contain selection-dependent groups. Each selection-dependent group is displayed as one of the selections for its parent selection group. The contents (subgroups and prompts) of a selection-dependent group are displayed to the end user only after the user selects that group for the parent selection group. For example:

---A user is given a choice of Laptop or Desktop for a computer type prompt.

---If the user selects Laptop as the value of the computer type prompt, then the user receives prompts for Battery Type, Hard Drive Size, and Processor Speed.

---If the user selects Desktop as the value of the computer type prompt, then the user receives prompts for Hard Drive Size, Processor Speed, and Type of Keyboard.

***** end quote;

cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1 reply
  • 1935 views
  • 0 likes
  • 2 in conversation