Add a query with parameters

Pentaho CTools

Version
10.2.x
Audience
anonymous
Part Number
MK-95PDIA006-12

Here, we will add a query with parameters.

  1. Select a Data Source.
  2. Name this data source. In the Properties pane, click in the Value column for the Name property and type chartQuery. Press Tab or Enter.
  3. Complete steps 2 and 3 of the Customize the Data Source task.
  4. Enter the MDX Query. In the Properties pane, locate the Query property and click the ellipsis icon to the right. The MDX Editor window displays.
  5. You will add the following query to the chartQuery:
    SELECT
        [Measures].[Sales] ON COLUMNS,
        [Time].[Months].Members ON ROWS
    FROM
        [SteelWheelsSales]
    WHERE ${productParam}
    You can notice the parameter productParam being referred on the WHERE clause (identified with the syntax ${parameterName}).
  6. To add this parameter to the data source, click in the Value column for the Parameters property.
  7. In the Name column, type productParam. In the Value column, type [Product].[Planes].[Autoart Studio Design].[1900s Vintage Bi-Plane]. Leave the Type column defaulted to String. Click Ok.
  8. Save your dashboard.

MDX Query of the data source customize example