Parameter Usage Scenarios
The purpose of parameters is to control the data in the dataset, such as data content, data display, data usage permissions, etc., so parameter applications are closely tied to datasets. Parameters are often used in the following scenarios.
- Dataset Creation Process
- Dataset Row Permission Control
- Dataset Content Changes
- Dataset Chart Creation
- Parameter Controls
Dataset Creation Process
During the dataset creation process, SQL statements, simple filters, and expression filters are used to filter data. In these scenarios, parameters can be used to flexibly control filter conditions, allowing the dataset's data to dynamically change with the parameters.
SQL Statements
In SQL statements, parameters are uniformly adopted in the format of {{%%parameter_name}}
. At this time, only text replacement is performed for the parameters without type validation. As shown in the figure, the parameter milestone_parameter
is used to filter data where milestone
equals 2.5.
SQL statements are only used in SQL Query datasets.
Simple Filtering
The usage of simple filtering is relatively straightforward; you can directly select parameters from the dropdown menu. As shown in the figure, the parameter milestone_parameter
is used to filter data where milestone
equals 2.5. In simple filtering, the parameter type needs to match the field type.
Dataset Connection, Multi-Table Union, and Dataset Union can use parameter filtering in simple filtering during dataset creation.
Expression Filtering
When using parameters in expression filtering, you can click the parameter at the bottom left to fill it into the expression text box. As shown in the figure, the default value of the parameter milestone_parameter
is 2.5. Using the expression {milestone} = {{%milestone_parameter}}
filters the data to select records where milestone equals 2.5, creating a new dataset.
Parameters can be used to control data in Data Connection and Multi-Table Union through expression filtering.
Dataset Row Permission Control
Row permissions can be dynamically controlled using parameters to define the scope of data accessible to users. As shown in the figure, the dataset Detail 1
is controlled by parameters to specify the data content accessible to User Group A. When the parameter value Start Date
changes, the content visible to User Group A also changes accordingly.
Dataset Content Changes
When creating new fields and new metrics in a dataset, you can use parameters to edit the content of fields and metrics.
When creating a new field, parameters enable dynamic fields. As the parameter value changes, the dynamic field will change accordingly, selecting the latest content for calculations and charting.
When creating a new metric, parameters enable dynamic metrics. Metrics change along with parameter values, as shown in the figure.
Creating Charts with Dataset
When creating charts in a dashboard, you can use parameters to control the display content of fields. As shown in the figure, in the chart filter, use the parameter expression:
{{Call Details 1}}.{Call Start Time} >= {{%Start Date}} AND {{Call Details 1}}.{Call Start Time} <= {{%End Date}}
to control the content of the Call Start Time
field, thereby controlling the display content of the chart.
Parameter Control
Parameter controls adjust parameter values to control the display of charts within the dashboard. As shown in the figure, adjusting the time parameter value allows you to retrieve data information for different time periods. Please read the Parameter Control section to understand how parameters control chart displays through parameter controls.
Summary of Parameter Usage
Parameters have various application scenarios. Please note that the usage differs between SQL statements and expression filters.
- The format for using parameters in SQL statements is
{{%%ParameterName}}
. - The format for using parameters in expressions is
{{%ParameterName}}
.