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: 
suvechha_b
Creator III
Creator III

KPI not working for Previous year

Hi All ,

Please kindly assist to get the KPI correct in Qliksense App .

My KPI calculation = 

Premium Received (Current Year)

Sum({$<[UWY_KEY] = {"$(=$(vMaxUWYear))"}>} [Receipt Amount BC])

Premium Received (Previous Year)

Sum({$<[UWY_KEY] = {"$(=$(vPrevUWYear))"}>} [Receipt Amount BC])

Capture1.PNG

 

My Qliksense script -

LOAD "UWY_KEY",
"UWY_NAME" AS "UWY Name" FROM 'lib://QlikData/Model_UMY.qvd' (qvd);

Where UWY_KEY is equal to "UWY Name".

But , when I am selecting "UWY Name" the value of "UWY_KEY" is showing "2019" but the above calculation is not working.

Please kindly assist.

Capture.PNG

 

 

The right side is "UWY Name" i.e 2019.

the variable - vMaxUWYear is showing 2019 and vPrevUWYear is showing 2018.

But the KPI calculation is not working for Previous Year. See image above.

 

Thanks 

Suvechha

 

 

1 Solution

Accepted Solutions
martinpohl
Partner - Master
Partner - Master

Hi,

you have selected UWY Name but calculate UWY_KEY in Expression.

But there is no UWY_Key with value 2018 when you have selected UWY_Name 2019.

So change the expression to

Sum({$<[UWY_KEY] = {"$(=$(vPrevUWYear))"}, UWY_Name = >} [Receipt Amount BC])

to exclude the selection of UWY_Name in aggregation.

Regards

View solution in original post

1 Reply
martinpohl
Partner - Master
Partner - Master

Hi,

you have selected UWY Name but calculate UWY_KEY in Expression.

But there is no UWY_Key with value 2018 when you have selected UWY_Name 2019.

So change the expression to

Sum({$<[UWY_KEY] = {"$(=$(vPrevUWYear))"}, UWY_Name = >} [Receipt Amount BC])

to exclude the selection of UWY_Name in aggregation.

Regards