Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Amberj_29
Contributor III
Contributor III

Previous Month vs Previous Month Last Year

Hello All,

 

I'm trying to do a basic thing, but I cannot work it out. I can do current month vs current month last year, but when I try to do this for Previous month vs previous month last year it doesn't work. I am trying to work out percentage difference

Here is my attempt:

((sum({<[Doc Date]={">=$(=MonthStart(AddMonths(Max([Doc Date]),-1)))<=$(=AddMonths(Max([Doc Date]),-1))"}>} [Net Value])) 

/

(Sum({<[Doc Date]={">=$(=AddYears(MonthStart(AddMonths(max([Doc Date])-1)),-1)) <=$(=AddYears(AddMonths(max([Doc Date]),-1))"} >} [Net Value])))-1  

 

This Last section does not work - I try to modify it from the current month vs current month last year but to avail. Please help 🙂

Many thanks,

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Change your below expression.

((sum({<[Doc Date]={">=$(=MonthStart(AddMonths(Max([Doc Date]),-1)))<=$(=AddMonths(Max([Doc Date]),-1))"}>} [Net Value])) 

/

(Sum({<[Doc Date]={">=$(=AddYears(MonthStart(AddMonths(max([Doc Date])-1)),-1)) <=$(=AddYears(AddMonths(max([Doc Date]),-1),-1))"} >} [Net Value])))-1

 

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

2 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Change your below expression.

((sum({<[Doc Date]={">=$(=MonthStart(AddMonths(Max([Doc Date]),-1)))<=$(=AddMonths(Max([Doc Date]),-1))"}>} [Net Value])) 

/

(Sum({<[Doc Date]={">=$(=AddYears(MonthStart(AddMonths(max([Doc Date])-1)),-1)) <=$(=AddYears(AddMonths(max([Doc Date]),-1),-1))"} >} [Net Value])))-1

 

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Amberj_29
Contributor III
Contributor III
Author

Thank you for your swift response. It works, I just thought I'll add a comment as there was a comma missing 🙂

((sum({<[Doc Date]={">=$(=MonthStart(AddMonths(Max([Doc Date]),-1)))<=$(=AddMonths(Max([Doc Date]),-1))"}>} [Net Value]))
/
(Sum({<[Doc Date]={">=$(=AddYears(MonthStart(AddMonths(max([Doc Date]),-1)),-1)) <=$(=AddYears(AddMonths(max([Doc Date]),-1),-1))"} >} [Net Value])))-1

Many thanks