Skip to main content
Pentaho Documentation

Create a Cascading Prompt

A cascading prompt changes based on a value a user selects. When the value in the drop down list, (Country), changes, the prompt is automatically applied to the second prompt, (City) thus changing its values.

File:/82_cascading_filter_sample.png

The example above was created using a Metadata List for the drop-down prompt (Country).

File:/84_cascading_metadata_query_sample_filter.png

A SQL List that included a parameter, ${selected_country}, in its associated query was used for the check box prompt (City).

File:/85_cascading_sql_query_sample_filter.png

The Default Value for the selected_country parameter was set to USA with New York City (NYC) as the initially selected value for the check box prompt.

File:/86_cascading_sql_query_parm.png

To link the City prompt to the Country prompt, another Source for the selected_country parameter was chosen. The alternate source is the Country prompt.

File:/87_cascading_filter_select_source.png

When the prompts are linked, users can choose a country and then choose a city (or cities) in the country of their choice.

Using this example, the report designer can now add a data table, chart, or other content in the dashboard that can be driven by the prompt he or she just created. Suppose the designer decides to add a pie chart to the dashboard. The pie chart will display the percentage of sales per city.

In the Query Editor, the report designer creates a parameter, {City}, with an extended default value: NYC|Las Vegas. The resulting pie chart displays values for New York City and Las Vegas. Under the Parameters tab associated with the pie chart, the Source value for the City parameter is changed to the City prompt.

File:/88_cascading_filter_init_piechrt.png

When the report is saved, users of the dashboard can see results for a country and multiple cities in that country.

File:/89_cascading_filter_final_piechrt.png