Dynamic Parameter

Description

This parameter control is commonly used to filter aggregated field identified in the “Filter” property and dataset property using aggregation pipeline.

This is a single-field filter and allows selection of one option at a time when used on the Dashboard Viewer. The values in the drop-down list corresponds to each value in the selected field defined in the “Filter”.

An example of such usage will be where there are data for 7 regions, but to display data for all 7 regions may be too overwhelming. You can use Dynamic Parameter Control to display one region at a time, and allow users to select the regions freely.

Viewer Usage

Upon landing in the Dashboard Viewer, the view will display the data records as per defined by the initial value of the selected field in the dataset aggregation pipeline (if defined).

When the Dynamic Parameter Control is expanded for selection, the view will display the initial value defined in the filter control. To select an option, simply select the value from the drop-down list.

Setup Dynamic Parameter Control

Setting up of the Dynamic Parameter Control involves 2 steps:

  • Setup aggregation pipeline in dataset
  • Setup Dynamic Parameter Control

Aggregation Pipeline

Prior setting up the Dynamic Parameter Control, the dataset need to setup the aggregation pipeline. Below is an example on how to setup aggregation pipepline for a dataset.

Example

In the Datasets module, select the desired dataset and click on the “Edit” icon under the “Actions” column. In the “Edit” panel, select the “Aggregation Pipeline” tab. Key in the code as required. Click on the “Save” button to save the code. Click on the “Cancel” button to abort the action.

In the above code, the parameter “Demo” will look for the matching “DOWAsc” field as in the data collection.

To test the code, click on the “Test Aggregation” icon at the upper right corner of the panel. The result is displayed on the right side of the panel, showing all data records in the “DOWAsc” field.

Dynamic Parameter Control Specific Properties

Below are the fields that are specific to this filter control:

Field Description Mandatory Input Type Constraints Default Value
Parameter Name Parameter defined in dataset aggregation pipeline. Y Textbox Align with the parameter in aggregation pipeline of dataset Empty
Label Defines the choices displayed in the control filter in the Dashboard Viewer. Y Drop-down list Select from drop-down list Empty
Value Defines the values to be used for the label in the control filter in the Dashboard Viewer. Y Drop-down list Select from drop-down list Empty
Initial Value Determines the initial value of the filter control upon expanded for selection. Y Drop-down list Select from drop-down list:
- First
- Last
- Value
First

Example

In the “Parameter Name” field, key in “Demo” as defined in the aggregation pipeline example. In the “Dataset” field, select the desired dataset that has aggregation pipeline being set up.

Select the same field as defined in the aggregation pipeline of the dataset for the “Value” field. In this example, its “DOWAsc”. In the “Label” field, select the field that should appear in the drop-down list in the filter control in the Dashboard Viewer. This field should be a 1:1 mapping of the field selected for the “Value”.

In the case where there is no other field that can match 1:1 to “Value”, “Label” should use the same field as “Value”, so that the choices in the drop-down list aligns with the values.

In the “Initial Value” field, there are three options:

  • First - first value in “Label” field, this is the default option
  • Last - last value in “Label” field
  • Value - defines the initial value

If the option “Value” is selected in the “Initial Value” field, a textbox will appear below the “Initial Value” field.

Key in the desired value in the textbox. Ensure the value key in is one of the values in the “Label” field. In this case, “Tuesday” is key in and it is one of the values in the “Label” field in the filter control property.

Click on the “OK” button after selecting the fields to save the settings. Click on the “Cancel” button to abort the action.

Rename Control

There may be a situation where you may wish to change the name of the filter control.

To rename the filter control, in the Dashboard Designer mode, click on the “Property” icon of the filter control. In the property dialog box, click on the “Rename Control” button. A “Rename Control” dialog box will appear.

Change the name of the filter control in the “Name” field. Select the “Update References” checkbox to update the name of the filter control in all the views that uses this filter control. If this field is not selected, you will need to update the name of the filter control in each of the views that uses this filter control.

Click on the “OK” button to save the changes. Clicking on the “Cancel” button aborts the action.