A parameter is a variable that can be flexibly adjusted. This variable can be used in calculated fields to implement dynamic logic solutions for a single calculated field or even an entire chart. When the parameter takes different values, the field expression will correspond to different calculation logic.
In sales scenarios, target values for a given time period are set as needed on a monthly, weekly, or daily basis. Because the target value changes dynamically based on business needs, the calculated value for target completion rate also changes dynamically. As shown in the figure below, it is possible to manually enter the target value and dynamically calculate the target completion progress.
There is a dataset where each group number corresponds to a set of data. The requirement is to select two groups, designating one as the experimental group and the other as the control group, to compare their data differences. It should also be possible to switch the experimental and control groups at any time.
Group | Result |
|---|---|
1201 | 11772228 |
1202 | 11829734 |
1203 | 11887240 |
1204 | 11944746 |
1205 | 12002252 |
1206 | 12059758 |
The effect achieved using parameters is as follows:

sum(if([组别]={个人}.{实验组},[数据结果],0)), and the expression for "Control Group Data" is: sum(if([组别]={个人}.{对照组},[数据结果],0)){Personal}.{Experimental Group} and {Personal}.{Control Group} fields are obtained from parameters. Double-click these fields to add them to the field expression box, then click the Confirm button in the lower right corner to save.([Personal].[Experimental Group Data]-[Personal].[Control Group Data])/[Personal].[Control Group Data]Users with project view permission or higher, and at least editing permission for one dataset, can create public parameters.
Public parameters must be configured with applicable datasets; only specified datasets can use these parameters. If there is no editing permission for any dataset, public parameters cannot be added.
When editing the dataset scope for an existing public parameter, regular users can only switch from "All datasets in the project" to "Some datasets" and cannot switch back to "All datasets in the project".
Administrators or regular users with project view permission or above can create and manage personal parameters. Personal parameters are at the project level. Personal parameters are available globally within the project, meaning that once personal parameters are created, they can be applied to all datasets.
a. Text parameters
Text parameters are divided into manual input, list selection, and dataset value extraction.
Manual input: Users can enter any value for the parameter in the input box for calculation. There are no restrictions on input.
List selection: Options with built-in parameter values. Users can only select from the values in the built-in list.
Dataset value extraction: Values are extracted from datasets, supporting extraction from datasets that are not directly connected to ClickHouse. Supported data sources that are not directly connected to ClickHouse include Hologres, StaRocks, and MySQL.
b. Integer and floating-point parameters
Integer and floating-point parameters are divided into manual input, list selection, and specified range. Manual input: Users can enter any value for the parameter in the input box for calculation. There are no restrictions on input. List selection: Options with built-in parameter values. Users can only select from the values in the built-in list. Specified range: The range of values users can enter can be limited (maximum and minimum values). By setting the step size, users can be restricted to only use certain values within the range. As shown in the figure below, only the values 1, 3, 5, 7, and 9 can be obtained. Other values are not accessible.
c. Date and time parameters
Date and time parameters only support manual input. The default value of the parameter can be set to a fixed date or a dynamic date.
In the field management section of the dataset editing interface, "Add Field" allows you to use all public parameters applied to the current dataset to create new fields.
In the visual query interface, "Add field" allows you to create new fields using all public parameters and personal parameters applied to the current dataset.
On the visual query page, if a field in the current chart uses parameters, you can pass the filter value from a date filter or metric filter as the value of the parameter used in the expression. For example, to calculate the average sales amount over a period of time, the calculation is generally sum(sales amount)/{count(days)}. However, if there is a day with no sales amount record, that day will not be counted when calculating the number of days, but in reality, that day should be included. This feature can be used to address this scenario. Steps:
If the field expression used for plotting and analysis contains parameters, or if the field expression directly or indirectly references parameters, then the visual query interface will display this parameter. You can set the visibility of this parameter in "In-chart parameters".
In the dashboard's global parameter configuration, you can configure the style and visibility of public and personal parameters.