KPI Widget
The KPI widget is designed to display one or more relevant numerical results. To this end, it has some specific features which an editor user should be familiar with if they wish to use them. In its normal mode, the KPI widget requires the query to only return a single row (1 record) which only has measures, and not dimensions. Therefore, when the query is valid, the KPI displays numbers, which can be assigned a certain style, through comparison levels:Simple KPI
Example of how to set the conditions of the style of a KPI
Comparator KPI
A KPI in "comparator" mode has a more complex but very useful behaviour.
- The correct use is combined with a date filter, a date feature (year, month, day), or a text field, which returns a single value (single selection). Otherwise the comparator mode does not have any effect on the KPI.
- The KPI query must return the dimension against which the comparison is to be made (otherwise the comparator does not have any effect), as well as all other desired measures.
- Under these conditions, the KPI obtains unique numerical values relative to the filter applied, but also "previous" values indicated by the user:
- It indicates how to get the previous or reference value in the widget customisation, when enabling the comparator mode.
- From the query indicated by the user, Vision also automatically obtains the previous value. In other words, it discriminates how to apply the single selection filter that is subject to the comparator setup to obtain 2 values per measure and not just 1 (the user does not have to worry about doing anything extraordinary with the query).
- A double comparison is made with the main value and the reference value, in absolute and relative value (to the reference).
- In the widget, you can display the main and reference value pair, and add the absolute and relative differences, as you choose.
- In addition, comparison levels can also be used to assign a style the KPI: the value taken to determine whether a level returns a true or false result is the relative difference (regardless of whether it is displayed in the widget).
Example of how to use a KPI in comparator mode