Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
rsdhavle
Creator III
Creator III

Aggregation issue when expression has rolling 12 months

Hi,

I have one expression with rolling 12 months when i write this expression in text object calculation is perfect. When i write this expression against Month Dimension in a straight table it gives me incorrect numbers as it seems aggregation is happening. How can we achieve so that it will give me correct expression value against each month.

13 Replies
rsdhavle
Creator III
Creator III
Author

Might be i have modified incorrectly..just to confirm..instead of SUM function everywhere i should use RangeSum function right?

Gysbert_Wassenaar

Ah, no. Replacing it everywhere won't work. If you read the document I linked to above you'll see that the expressions don't replace every sum with a rangesum. The rangesum function is not an aggregation function, but calculates the sum of all the values used as parameters. So rangesum( 12, 8, 10 ) returns 30. Rangesum can be used in combination with the Above function where the Above function returns a list of values from previous rows and then rangesum will sum those values.


talk is cheap, supply exceeds demand
rsdhavle
Creator III
Creator III
Author

Hi Gysbert..we have implemented 12 month logic using RangeSum() but it is not considering negative values it seems.

Basically, i am trying to implement something like the attached sheet, formula's of the same are mentioned in the sheet.

The final output is L column highlighted in green.

Gysbert_Wassenaar

Rangesum does not disregard negative values unless you force it to do so. Can you post a small qlikview document that demonstrates the problem?

BTW this looks like a straightforward problem that can be solved with Rangexxx functions or with an AsOf table. Both options are explained in the document I linked to above.


talk is cheap, supply exceeds demand