Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

set analysis to sum of sales of last 3 months.

Hi,

i need to write a set analysis to calculate sales done in last 3 months.

For example....if the current selected month is Jan of year 2104 then the my formula should sum the sales done Oct, Nov and Dec of 2013...if the current selected month is Feb, 2014 then formula should sum the sales done in Nov 2013, Dec 2103 and Jan 2014.

Can you please me writing this expression?

Regards,

Saurabh

1 Solution

Accepted Solutions
Not applicable
Author

Hi, Ramya

Its look like this:

=Sum({<Date={">=$(=MonthStart(AddMonths(Max(Date),-3)))<=$(=MonthEnd(AddMonths(Max(Date),-1)))"}>}Sales)

Change (-3) and (-1) to set your period

View solution in original post

2 Replies
Not applicable
Author

Hi, Ramya

Its look like this:

=Sum({<Date={">=$(=MonthStart(AddMonths(Max(Date),-3)))<=$(=MonthEnd(AddMonths(Max(Date),-1)))"}>}Sales)

Change (-3) and (-1) to set your period

jim_chan
Specialist
Specialist

Hi Alex,

can you tell me what is the -3 means and -1 means?