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

n Month average with multiple dimensions in straight table

Hi all,

I need to make a summary table that calcalate the 3 months average with mulitple diminsions in straight table is as below:

DateRegionA3 Month Avg(A)(Explaination)
2011/11A217.972.6(0 + 0 + 217.9)/3
2011/12A275.6164.5(0 +217.9 + 275.6)/3
2012/01A457.8317.1(217.9 + 275.6 + 457.8)/3
2012/02A456.1396.5
2012/03A477.1463.7
2012/04A357.7430.3
2012/05A0278.3( 477.1 + 357.7 + 0)/3
2012/06A0119.2( 357.7 + 0 + 0)/3

I got the Date, Region and A and I need to calculate the average of A (3 Month Avg(A)). I have make a explaination column in the above example to make it clear what i want to do.

As it is multiple dimensions, I cannot use rangesum & above and i tried to use aggr but no joy. Also, by input a int, it can calculate any month avg, so..I cannot hard code the formula just calculate 3 months..

Please kindly help.

Best Regards,

Nick

1 Solution

Accepted Solutions
Not applicable
Author

Try this:

RangeSum(above(TOTAL Sum(A),0,3)) / 3

View solution in original post

3 Replies
Jason_Michaelides
Luminary Alumni
Luminary Alumni

I'm in the train so can't test this now but I can't see why RangeSum() and Above() won't work:

RangeSum(Above(Sum(A),0,vSteps)/vSteps

Where vSteps is your input variable.

Hope this helps,

Jason

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Missed off a parenthesis...

RangeSum(Above(Sum(A),0,vSteps))/vSteps

Not applicable
Author

Try this:

RangeSum(above(TOTAL Sum(A),0,3)) / 3