Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
WernerDC
Creator
Creator

KPI's

Good day,

I am sure this is not a hard thing to do but I cant seem to find a way to do it.

When creating a KPI with 2 measures I want the second 1 to show the previous year.

So when I select 2019 Financial year. I want the second measure to show 2018.

See here my KPI and the Measure

 

Thank you 

2 Solutions

Accepted Solutions
Tim_Wensink
Partner - Contributor III
Partner - Contributor III

Hello Werner,

This can be done by using set analysis. If you select one year and the expression for the first measure = sum(sales), the expression for the second measure can be :

sum({$<Year={$(=only(Year)-1)}>}Sales)

Which means the sum of sales is calculated for the selected year minus one. This will only work if there is exactly one year selected, if you always want to show the sales of last year you could use:

sum({$<Year={$(=year(today())-1)}>}Sales)

(and for the current year it would be sum({$<Year={$(=year(today()))}>}Sales)

Greetings,

Tim Wensink

View solution in original post

Uday_Pasupuleti
Partner - Creator III
Partner - Creator III

HI,

Use this in your set analysis expression

Year Field= {"$(=Max(Year Field)-1)"}

View solution in original post

2 Replies
Tim_Wensink
Partner - Contributor III
Partner - Contributor III

Hello Werner,

This can be done by using set analysis. If you select one year and the expression for the first measure = sum(sales), the expression for the second measure can be :

sum({$<Year={$(=only(Year)-1)}>}Sales)

Which means the sum of sales is calculated for the selected year minus one. This will only work if there is exactly one year selected, if you always want to show the sales of last year you could use:

sum({$<Year={$(=year(today())-1)}>}Sales)

(and for the current year it would be sum({$<Year={$(=year(today()))}>}Sales)

Greetings,

Tim Wensink

Uday_Pasupuleti
Partner - Creator III
Partner - Creator III

HI,

Use this in your set analysis expression

Year Field= {"$(=Max(Year Field)-1)"}