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: 
sth_wch004
Contributor III
Contributor III

Qlik Sense - Sum This Month vs Last Month same date

Dear Community,

How to sum this month vs last month same date?

Records:

Date(DD-MM-YYYY)  Value

01-10-2017              5

02-10-2017              50

03-10-2017              17

04-10-2017              30(Should exclude this record)

01-11-2017              15

02-11-2017              30

03-11-2017              2

Expected Result:

Month Year    Value

Oct' 17          32

Nov' 17          47

32 = 5+ 50 + 17

47 = 15 + 30 + 2

I tired the Expression:

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


1 Solution

Accepted Solutions
luismadriz
Specialist
Specialist

My bad, I should've properly read your text

I imagine you meant 73 instead of 32 right?

I'm struggling to get this Set Analysis working, please take a look. Also, what defines that 3/11/17?

I created YEARMONTH during the script

Untitled.png

View solution in original post

5 Replies
luismadriz
Specialist
Specialist

Hi,

Maybe this one?

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

sth_wch004
Contributor III
Contributor III
Author

Thanks for your reply,

Return 0 value.

luismadriz
Specialist
Specialist

My bad, I should've properly read your text

I imagine you meant 73 instead of 32 right?

I'm struggling to get this Set Analysis working, please take a look. Also, what defines that 3/11/17?

I created YEARMONTH during the script

Untitled.png

luismadriz
Specialist
Specialist

I meant 72

sth_wch004
Contributor III
Contributor III
Author

Thanks it is working