A visualization should provide the user with a careful and effective presentation of the data. Numbers have an impact value and they contain a message. Key performance indicators demonstrate the importance of numbers in business and also communicate the health of the business to the audience.
We will make use of the application from the preceding recipe. The application has the following script loaded, it gives information on the Sales
and Target
values for four countries:
LOAD * INLINE [ Country, Sales, Target USA, 10000, 8500 UK, 7000, 9500 Germany, 5000, 4500 Japan, 6000, 6000 ];
KPI
and open it.(Sum(Sales)-Sum(Target))/Sum(Target)
Sales vs Target
.Sales vs Target
.IF(getselectedcount(Country)>0,Country,' ')
Reports
.Table
report on the reports sheet with Country as the dimension and the following measures:Sum(Sales)
: Label it Sales
.Sum(Target)
: Label it Target
.(Sum(Sales)-Sum(Target))/Sum(Target)
: Label it Sales vs Target
. For the measure, change the number formatting to number and select the percentage format (12.3%) from the available formats under dropdown.The KPI object is an important visualization object on any dashboard. The color segments we defined in the properties determine if the country is doing better than its set target value or not. If the sales are below the target values then the KPI figure is shown in red or else in green. Linking the KPI to the Reports sheets helps the user to dig deep into the data and see the more granular figures.
The KPI object can also be represented using two measures. We can show a comparison between key figures in a single KPI object. For example, the absolute sales and target values can be shown adjacent to each other as separate figures. If the sales are greater than the target then the value is represented in a green color or else in a red color.
This can be achieved by following the steps mentioned in the following steps:
Sales vs Target-1
.Sum(Sales)
: Label it Sales
Sum(Target)
: Label it Target
Sales
switch on the conditional colors.=Sum(Target)
Target
, select the font color as Blue