Introduction
There are 2 ways to apply a widget filter :
- on the raw values : each row in the raw dataset is evaluated against the filter condition
- on the aggregated values : the raw dataset is first aggregated by the Widget, and only then the filter condition is applied
Example
The Data Source
Imagine a simple dataset :
TagName | Building | Product | Price |
---|---|---|---|
FT101.Value | Building A | Product X | 10 |
FT102.Value | Building A | Product Y | 15 |
FT201.Value | Building B | Product X | 20 |
FT202.Value | Building B | Product Y | 25 |
FT301.Value | Building C | Product X | 30 |
FT302.Value | Building C | Product Y | 35 |
The Widget
You are displaying this data in a Pie Chart with Sum
(Price) grouped by “Product”, you get :
Product | Sum(Price) |
---|---|
Product X | 60 |
Product Y | 75 |
Filtering raw values
You apply a filter on the raw value to see only data where :Price > 20
The raw dataset will be filtered like this :
TagName | Building | Product | Price |
---|---|---|---|
FT202.Value | Building B | Product Y | 25 |
FT301.Value | Building C | Product X | 30 |
FT302.Value | Building C | Product Y | 35 |
And the Widget will display the following :
Product | Sum(Price) |
---|---|
Product X | 30 |
Product Y | 60 |
(because 60 = 25 + 35)
Filtering aggregated values
You apply a filter on the aggregated value to see only data where :Sum(Price) > 70
It is not the raw dataset that will be filtered.
The Widget will display the following :
Product | Sum(Price) |
---|---|
Product Y | 75 |
(Product X was filtered because its Sum(Price) was 60 <= 70)
How to filter by aggregated values
For each filter condition, you can check Use Field Aggregate :
Then select the desired aggregation function :
Note on non-numerical fields
On fields where the data type is not number (string, date, boolean), the aggregation functions will return a number, so the condition becomes a number condition.
For those fields, the list of available aggregation functions is also different :
For example, the resulting filter condition below reads as :
Distinct Count of EquipmentName < 3
Post your comment on this topic.