SAS provides
multiple methods for setting up
cascading prompts (a sequence of dependent prompts). You can define such a cascade
in SAS Information Map Studio by selecting the option to establish
dependencies for the prompts in a compound filter. When dependencies
are established in a filter, each prompt in the filter is dependent
on every filter rule (whether it contains a prompt or not) that precedes
it in the filter expression.
In this
scenario, your end users are complaining that the existing department
prompt (in the Employee Statistics Sample information map) forces
them to scroll through a long list of departments—they want
to choose from the departments that exist at their respective locations
only. So you want to create a filter that will enable a user to first
select a location and then select from departments at that location.
You will
modify the prompted filter that you created earlier and add to the
filter an additional rule that includes a location prompt. This location
prompt will be the prompt at the top of the cascade. The existing
department prompt will be the dependent prompt.
Note: This scenario
defines a two-prompt cascade, but you can cascade more than two prompts.
-
Open the
Employee Statistics Sample information map.
-
In the
SAS Information Map Studio main window, select the
Design tab.
-
In the
Information Map Contents pane, right-click
Which department?, and then select
Properties from the pop-up menu to open the
Edit Filter dialog box.
-
In the
Data item drop-down list on the
Definition tab, change the selection from
Department to
Location.
-
In the
Value(s) section, click
New to open the
New Prompt dialog box.
-
To create the prompt, complete these steps:
Note: Accept the
default settings for any fields that are not mentioned.
-
In the
Name field on the
General tab,
enter
Location Prompt
.
-
In the
Displayed text field, enter
Please select
a location:
-
Select
the
Prompt Type and Values tab.
-
In the
Prompt type drop-down list,
Text is preselected for you because the associated filter is based on
character values.
-
From the
Method for populating prompt drop-down list, select
User selects values from a dynamic list.
Note: You can use
any method to obtain values for the prompt in the first filter rule
of a compound filter (that is, you can select any value for the
Method for populating prompt field for that prompt).
But each (subsequent) dependent prompt must be a dynamic prompt (that
is, the value for the
Method for populating prompt field must be
User selects values from a dynamic list). Otherwise, the cascade will not execute correctly.
-
In the
Data source section, make sure that
Use
the current information map is selected. You cannot cascade
prompts that use tables or other information maps as their respective
data sources.
-
Click
the
Specify button that is next to the
Default value field.
-
In the
Default Value dialog box, select
Cary and click
OK to add it as the default value.
-
Click
OK to create the prompt and return to the
Edit Filter dialog box.
-
Click
Add to add this new filter rule to the filter expression.
The new rule should be automatically selected in the
Filter
combinations table.
-
The order
of dependency is based on the order of the rules in the filter expression,
so arrange the filter rules in the order that you want the prompts
to be processed. Click
to make the new rule the first rule in the filter
expression.
-
Select
Establish dependencies between prompts.
-
Click
OK to update the filter.
-
Save the
information map with the name
Employee Statistics Sample
with Cascading Prompts
.