Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
Contributor II

Fiscal Year issue

Hi,

I have an KPI showing sum of Current Fiscal Year Sales .

Fiscal year column have data for FY 2021, FY2020 , FY2019 etc

For KPI I want Sum(Sales) for FY 2019.

I have created a variable 

LET vCnFY = PEEK('Fiscal Year', 0 ,'Calendar');

and vCnFY gives me 2019 and KPI shows correct data .

But if I select FY2018 KPI still shows for FY2019. So KPI is not changing with filter selection

KPI expression looks like this : Sum({$<[Fiscal Year ]={'$(vCnFY )'}>}Sales)

I cannot use Max function because it will show me FY2021 data in KPI.

2 Replies
Highlighted
MVP
MVP

Re: Fiscal Year issue

>>I cannot use Max function because it will show me FY2021 data in KPI.

Not true. If you select FY2018, then the max, if defined correctly, will be 2018.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Contributor III

Re: Fiscal Year issue

You can create a variable, vMaxYear - If(GetSelectedCount([Fiscal year])=1,Max([Fiscal year]),$(vCnFY)) Then use this variable in the expression, Sum({$<[Fiscal Year ]={'$(vMaxYear)'}>}Sales)