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

store KPI value for later usage

Hi, does anybody have recipe have easily store today value in KPI chart and use tomorrow for comparing with new one?

Labels (1)
  • Chart

4 Replies
JustinDallas
Specialist III
Specialist III

Generally, I would have a "IsYesterday" flag, and then use that in my set analysis.  It can then be calculated at load time or declared in the UI

SUM({<[IsYesterday]={'Y'}>} Widgets)

 

You would have to create this flag using a calendar or some other date in your script i.e 

 If( InDay(SomeDateInYourDataModel, Today(), -1 ) , 'Y','N' )
Micki
Creator
Creator
Author

ok, please correct me if I am wrong:

1. I need to add 

 

 

 If( InDay(SomeDateInYourDataModel, Today(), -1 ) , 'Y','N' )

 

to table load script with data dimension 
2. add to KPI instead of ex. Sum(Sales) -> 

 

SUM({<[IsYesterday]={'Y'}>} [Sum(Sales)])​

 

Correct ? 

Micki
Creator
Creator
Author

@JustinDallas  thank you so much for your answer, but it's not working 😞 Could please send the sample .qvf with dummy data ?

 

JustinDallas
Specialist III
Specialist III

If you provide the dummy data I might be able to help.