Data
Reading time:
Optional where condition
Here you can add a where condition to the query used to initialize the widget if needed. Clickhouse SQL syntax required, The syntax is similar to SQL Server.
e.g.
Limit
You can limit the number of rows to be displayed, for example, we have this chart : number of stays by type, but I'd like to display only the first 3 types with the highest number of stays,
To achieve this display,
- Under Measure set Descending order as order
- Under Dimension, set None as order
- Set 3 to limit
If you enable Group data, and set 3 to limit the number of rows, the 2 first types will be displayed and the other types will be grouped with others.
Exclude hidden data
As you know, we can hide a dimension or a measure from a widget with the below option.
This action only hides the dimension from display, but it is still present in the query, which can sometimes make the results hard to understand. See this example.
We have a widget with two dimensions: stay type and stay month. The second dimension is hidden, and the measure is sorted in descending order. But if you look at the results, the order seems weird. Indeed, the sorting is done on the combination of stay type and stay month, even if stay month is hidden in the widget,Â
What we need is to sort only by stay type, in this case, we can activate the ' Exclude hidden data', the hidden dimension will be excluded from the query.
Here is the result after enabling the option.
Custom data snippet (Advances level)
Create PHP snippets, not using a query but PHP code to execute code.There's a flag in Admin hub in order to enable the PHP snippet creation.
Result mapping function (Advanced level)
You can manupulate via JS the query result before visualizing them in the widgt. it can change the values in the JSON and you can edit the whole result set at once, Custom formatting enables you to edit one value at time instead.