Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Accumulate in set analysis

I have a chart with the following structure. In the column to the right I want to sum the sale for the current month + the sale for the 2 next months. E.g. 2013-01 should show 22 (5+10+7)

MonthSales

Sales within 3 months

2013-01522
2013-0210

2013-03

7
2013-042

How should I do this?

5 Replies
javier_florian
Creator III
Creator III

You can create a new dimension with quarter function... Let me know if it work for you.

- Javier Florian

Carlos_Reyes
Partner - Specialist
Partner - Specialist

Try:

RangeSum(below([Sales], 0, 3))

Not applicable
Author

Carlos, this doesnt work for me as I need to be able to select just one month and still show the right amount. Is it possible to do something similar with set analysis?

Something like this?

Sum({$<YearMonth={">=$(YearMonth)<=$(=Date(AddMonths(YearMonth),+2))"}>}Sales)

Not applicable
Author

Hi, Anton

Carlos Alberto is right. You can learn more about accumulate rolling n-period total at here :

http://community.qlik.com/docs/DOC-4252

Wish it help.

Regards,

Zhou

Not applicable
Author

Thank you Zhou for the link.

The AsOf example is the way I need to do it, not rangesum.

"The 'problem' is that the set is calculated once for the entire chart, not per row. This means that it's not possible here to use Month both as a dimension and in the set modifier in the expression.

There's still an option left to discuss: AsOf tables."