# Qlik Sense App Development

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

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
Valued Contributor III

## Re: QlikSense - current month data vs previous month

Hi Egor,

Please see the below screenshots and attached qvf file:

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":

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.

5 Replies
Valued Contributor III

## Re: QlikSense - current month data vs previous month

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:

Hope this helps.

Thanks

Highlighted
Not applicable

## Re: QlikSense - current month data vs previous month

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?

Valued Contributor III

## Re: QlikSense - current month data vs previous month

Hi Egor,

Please see the below screenshots and attached qvf file:

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":

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

## Re: QlikSense - current month data vs previous month

Thank you Sinan! That's all I need!

Valued Contributor III

You are welcome.