Comparing indicators with Multi KPI Goal: compare current year with previous year sales in same KPI. See image below.In load editor add script:sales:
...
Show More
Comparing indicators with Multi KPI
Goal: compare current year with previous year sales in same KPI. See image below.
In load editor add script:
sales:
load * inline [
year, sale,
2017, 50198,
2018, 61532,
2019, 63182
];
1) Add Multi KPI object (extension Qlik Sense)
2) Add a dimension
=ValueList('Current year', 'All')
3) Add variables
4) Configure KPI appearance
Properties Appearance > Dimensions
- Hide labels: true
- Center aligned labels: true
- Hide external borders: true
- Hide internal borders: true
5) Add a measure Current Year Sales
Properties:
- Expression: =sum({<year={"$(vCurrentYear)"}>} sale)
- Label: ='Sales $(vCurrentYear)'
- Number formatting: Money
- Group by dimension: true
- Dimension Value: Current year
- Icon: ='lui-icon lui-icon--line-chart'
- Icon size: Large
6) Add a measure Previous Year Sales
Properties:
- Expression: =sum({<year={"$(vPreviousYear)"}>} sale)
- Label: ='from $(vPreviousYear)'
- Number formatting: Money
- Label color: #7b7a78
- Value color: #7b7a78
- Group by dimension: true
- Dimension Value: Current year
- Override parameters: true
- Size: Tiny
- Labels order: Value, Label
7) Add a measure Current Year vs Previous Year Percentage
Properties:
- Expression: =(sum({<year={"$(vCurrentYear)"}>}sale)/sum({<year={"$(vPreviousYear)"}>}sale))-1
- Number formatting: Number (12,34%)
- Label color: #7b7a78
- Value color: #7b7a78
- Hide label: true
- Group by dimension: true
- Dimension Value: Current year
- Override parameters: true
- Icon: =if((Sum({<year={"$(vCurrentYear)"}>}sale)/Sum({<year={"$(vPreviousYear)"}>}sale))-1>0,'lui-icon lui-icon--triangle-top','lui-icon lui-icon--triangle-bottom')
- Icon position: Value
- Icon order: Value, Icon
8 ) Add a measure All sales
Properties:
- Expression: =sum(sale)
- Label: All
- Number formatting: Money
- Group by dimension: true
- Icon: ='lui-icon lui-icon--sheet'
- Icon size: Large
9) Add a measure Annual average
Properties:
- Expression: =sum(sale)/count(distinct year)
- Label: annual average
- Number formatting: Money
- Label color: #7b7a78
- Value color: #7b7a78
- Group by dimension: true
- Override parameters: true
- Size: Tiny
- Labels order: Value, Label
Done!
Best regards,
Ezir
Show Less