Qlik Community

Qlik Sense App Development

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

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
materi
New Contributor III

Date problem

I want to have a KPI with values from the previous month in an app, and I don't know how to do that easily. I want to use an expression that looks something like:

Sum({$<Period={Magic}>}Size)

...such that the size for the previous month is shown in the KPI. What code can I use in the Magic section of that expression? The autoCalendar expressions didn't do anything since they just pick up the actual time from the computer and not the stored time data in the database.

3 Replies
Rick_T
New Contributor III

Re: Date problem

Hi Materi, 

Can you post a sample app here? 

I use the following expression in the load editor to make a variable: 

Let vLastMonth = date(AddMonths(today(), -1), 'MM'); 

This returns the number of last month so in my case it says '07' right now. So in your case the set expression will be something like this: Sum({$<Month={$(vLastMonth)}>}Size)

Maybe this helps. 

 

sincerely, 

Rick

Highlighted
materi
New Contributor III

Re: Date problem

Thanks for your response, Rick! But my problem is that I need to take the dates from my server, so I can't use the real time and thus not the built-in Date expressions in Qlik.

Rick_T
New Contributor III

Re: Date problem

Can you post the date format that you import from your server?