Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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
sinanozdemir
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
sinanozdemir
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
Author

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?

sinanozdemir
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.

Not applicable
Author

Thank you Sinan! That's all I need!

sinanozdemir
Specialist III
Specialist III

You are welcome.

nituverma097
Contributor III
Contributor III

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