Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
KIdriss
Contributor II
Contributor II

kpi with the percentage increase or reduction compared to last year.

Hello,
I would like to know how to construct a kpi with the percentage increase or reduction compared to last year.  

I have a periodData column in the following format "dd/mm/yyyy"

In load data step i add this lines:

```
SET DateFormat='DD/MM/YYYY';
SET TimestampFormat='DD/MM/YYYY h:mm:ss[.fff] TT';

```

The first kpi i add is: Sum({<[periodDate.autoCalendar.Year] = {"$(=Max(Year(periodDate)))"}>} Value)

The expression i set in the second kpi is: Sum({<[periodData.autoCalendar.Year] = {"$(=Max(Year(periodData)) - 1)"}>} Value) 

I have the same result as if I had set sum(value)

 

Data:

periodData Value
01/01/2000 100
01/01/2001 201
01/02/2001 82
01/01/2002 303
01/02/2002 350
01/03/2002 205
Labels (1)
  • Chart

0 Replies