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 option defined in the “Filter”. Therefore, you may limit the data that will be displayed in the view.
An example of such usage will be where there are data for seven regions, but you only want to display five of the regions. You can use Fixed Parameter Control to limit the regions, and allow users to select among the five regions freely.
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.
When the Fixed 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.
The sequence of the options is as defined in the filter control property.
Setting up of the Fixed Parameter Control involves 2 steps:
- Setup aggregation pipeline in dataset
- Setup Fixed Parameter Control
Prior setting up the Fixed Parameter Control, the dataset need to setup the aggregation pipeline. Below is an example on how to setup aggregation pipepline for a dataset.
In the Dataset Management, 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 “Region” field as in the data collection. The value for parameter “Demo” is set as “Midwest”.
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 with the value “Midwest” in the “Region” field.
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|
|Choices||Determines the selectable values in the control filter in the Dashboard Viewer.||Y||Textbox||Must align with the values of the field defined in aggregation pipeline of dataset||Sample code|
|Initial Selection||Determines the initial value of the filter control upon expanded for selection.||N||Textbox||One of the choices in the “Choices” field||Sample
Corresponds to the first label in “Choices” field
In the “Parameter Name” field, key in “Demo” as defined in the aggregation pipeline example. To edit the code in the “Choices” field, click on the textbox and the “Edit Choices” dialog box will appear with a sample code.
The “label” field will be the label that will appear in the drop-down list in the filter control in the Dashboard Viewer. The “value” field will be the value for “label”.
For the example above, the below code is added into the “Choices” field.
In the “Initial Selection” field, by default the value is “Sample”, which corresponds to the first label in the sample code in “Choices” field. If the value defined in this field does not falls within the labels defined in “Choices” field, this value will be ignored. The first label in the “Choices” field will be used instead. If the value is defined, for example “West”, the value “West” will be the initial label when the filter control is expanded for selection. In this case, it is left unchanged as “Sample”.
Click on the “OK” button after editing the code. Click on the “Cancel” button to abort the action.
It may be recommended to align the “Initial Selection” field (if defined) or the first label in the “Choices” field with the value defined in the aggregation pipeline of the dataset. This is to avoid a sudden change in the view displayed when the filter control is expanded for selection.