Qlik Community

Qlik Sense App Development

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

Announcements
Customers, Partners & Luminaries only: You're invited to a Data Analytics Roadmap session. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

QlikSense - current month data vs previous month

Hello,

I am trying to create a sheet to display difference between previous month and current month data amounts.

So far I have tried to get amount difference for current month but no luck. Ideally I should get amount difference for every month.

My script is as follows (see attached project also):

sum({1<Date = {">=$(=monthstart(Today()))<=$(=monthend(Today()))"}>}Amount) - sum({1<Date = {">=$(=monthstart(AddMonths(Today(), -1)))<=$(=monthend(AddMonths(Today(), -1)))"}>}Amount)

but it gives me incorrect results. Any Ideas?

1 Solution

Accepted Solutions
Highlighted
Specialist III
Specialist III

Hi Egor,

Please see the below screenshots and attached qvf file:

Capture2.PNG

As you can see from the above, based on user's selection "Current Month and Previous Month" numbers change.

Here is the expression for "Current - Previous":

Capture.PNG

In the attached qvf, please see the sheet name "New Calculation".

And if this answers your question, can you please mark this answer as the correct answer?

Thank you.

View solution in original post

6 Replies
Highlighted
Specialist III
Specialist III

Hi Egor,

Can you check the new calculation sheet in the attached app? I created three text boxes, try to close the whole expression with brackets:

Capture.PNG

Capture2.PNG

Hope this helps.

Thanks

Not applicable

Hello Sinan,

Yes it works, thank you very much!

Also how do I get amount difference not only for current month, but for every (e.g. selected) month?

Highlighted
Specialist III
Specialist III

Hi Egor,

Please see the below screenshots and attached qvf file:

Capture2.PNG

As you can see from the above, based on user's selection "Current Month and Previous Month" numbers change.

Here is the expression for "Current - Previous":

Capture.PNG

In the attached qvf, please see the sheet name "New Calculation".

And if this answers your question, can you please mark this answer as the correct answer?

Thank you.

View solution in original post

Highlighted
Not applicable

Thank you Sinan! That's all I need!

Highlighted
Specialist III
Specialist III

You are welcome.

Highlighted
Contributor II
Contributor II

Hi,  I am also stuck here. It will give the correct month but not give any values, it gives 0 value. Please find the screenshot.

 

 

 

nituverma097_0-1593008609693.png