Skip to main content
Pentaho Documentation

Other prompt types

Parent article

In addition to dashboard prompts, you can these types of prompts:

  • Toolbar Prompts
  • Date Prompts
  • List Prompts

Create a toolbar prompt

You can create a toolbar prompt which enables users to refine report results in a dashboard. First, create the prompt toolbar. Then customize the toolbar so the appropriate options appear.

Procedure

  1. Open a dashboard which contains at least one parameterized report.

  2. Click the Edit Content icon to open the editing options in the dashboard.

  3. In the bottom section, inside the Objects pane, choose Prompts to access the Prompt pane.

  4. Click Show Prompt Toolbar to display the prompt toolbar to dashboard users.

  5. Click Add to add a prompt.

    The Prompt dialog box appears.
  6. In the Name field, enter the title for the prompt toolbar.

  7. In the Control box, click the format for the prompt options.

    For example, you can choose the drop-down control if you want a list which appears when users click the first option.
  8. Ensure that Static List is selected under Type.

Customize toolbar prompts

Perform the following steps to customize your toolbar prompts:

Procedure

  1. In the Data box, click Add.

    The List Value dialog box appears.
  2. In the Label field, enter the option name as you want it to appear to dashboard users.

  3. In the Value field, enter the parameter source name.

    If using the Steel Wheels sample, enter Classic Cars.
  4. Add labels and values for each parameter you want to filter. Click Close to exit the List Value dialog box.

    If you are filtering an Analyzer report and using a static list, you can add the option All. This option drops the filter from the report and shows all values.
  5. In the Control Properties box, under Initially Selected, choose which item you want to appear first in the prompt list.

    Choose Use First Value to set the default to the first value in the list, or you can choose Specify if you want a specific value to appear first.
  6. Click OK.

  7. In the Objects pane, choose the title of the report you want to filter. Click the Parameters tab and choose the correct Source for the parameter from the list.

    The source should be the name of your prompt.
  8. Click Save.

Creating a date prompt

The date picker prompt allows users to select values based on calendar dates. When creating a date picker prompt, you will need to set a date format which the user will select using the date picker prompt. By default, the format used is yyyy-MM-dd.

The date picker prompt uses Dojo date formats. In the past, this component was based on the JQuery Date Picker, and to support legacy formats, the old formats will be converted automatically.

Not all formats are supported or make sense when a date is selected. For instance, anything with less granularity than a unit of 'day' will default to the Dojo format, so we encourage you to use any format from 'd' to 'y' which is currently supported by the date picker control type. You can use any desired configuration where 'yyyy-MM-dd', 'yy-M-d' or 'd/MM/yyyy' is a valid format.

As a result the pattern can be any combinations of the following patterns of years, quarters, months and days:

PatternDescriptionExample Date: Monday, January 4, 2016
GeraAD
y or yyyear (two digit)16
yyy or yyyyyear (four digit)2016
q or Qquarter (one digit)1
Mmonth numeric (no leading zero)1
MMmonth numeric (two digit)01
MMMmonth name shortJan
MMMMmonth name longJanuary
dday of month (no leading zero)4
ddday of month (two digit)04
Dday of the year4
Eday of the week2

Create a list prompt

When you create a metadata list, you are defining a query to retrieve a list of display names and corresponding values from a metadata data source provided by your administrator.
NoteYou must have a data table or chart which contains at least one parameter for your prompt control to function correctly.
Filter dialog box

Procedure

  1. In the dashboard page, under General Settings, select Prompts.

    The Prompt Editor appears on the right. No prompts are listed if this is the first time you are assigning prompts.
  2. To display a prompt toolbar to users of the dashboard, enable Show Prompt Toolbar.

    A placeholder for the prompt toolbar appears at the top of the dashboard.
  3. Click the Add icon to add a prompt.

    The Prompts dialog box appears.
  4. In the Prompts dialog box, enter a Name for your prompt.

  5. Under Data Type, choose Metadata List.

  6. Click Select to choose the data source which contains the content you need to set options from the drop-down list and click OK.

    The Query Editor opens.
  7. In the Query Editor, build a query to choose either a single column (which represents both a name and a value), or two columns representing the display names and corresponding values.

    If a single column query is defined, the values of that column will be used for both the display names and the values.
  8. Click OK to exit the Query Editor.

    Your options appear under Selected Items in the Prompts dialog box.
  9. Under Control Properties, enter a default Label and Value for the initially selected option in your prompt control.

  10. Select a Label to display in the prompt control.

    This is the user-friendly name which users will see in the dashboard.
  11. Select the Value.

    This is the value in the database which is associated with the label you selected in the previous step.
  12. If applicable, choose your Display type from the list.

    Some prompt controls allow you to choose the position of your prompt options. If you have a long list of options, such as a list of cities, options may not appear correctly in the user console unless you change the Display type to Horizontal.
  13. Click OK.

Results

The list of values appears in the prompts toolbar in the dashboard.

Create a cascading list prompt

A cascading prompt changes based on the value a user selects. For example, when the value in the drop-down list Country changes, this prompt is automatically applied to the second prompt, City, which changes its values.

This task uses the example of creating a country-city cascade prompt. Cascading prompt example

Procedure

  1. For Type, select Metadata List to create the drop-down prompt Country.

    Filter from metadata list
  2. For Type, select SQL List which includes a parameter, ${selected_country}, in its associated query for the check box prompt City.

    Filter from SQL list
  3. Set the Default Value for the selected_country parameter to USA with New York City (NYC) as the initially selected value for the check box prompt.

Results

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. 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 which can be driven by the prompt he or she just created. If the designer adds 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.

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