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

Summing across a pivot table

Hi All

Is it possible to sum across a pivot table to get an average over 2 months to perform a calculation?

Scenario

Attached pivot table screenshot

the calculation is

sum(stock) for Oct / ((sum  sales for Oct) +sum(Sales for Sep) / (count #weeks for Oct) + count(#weeks for Sep))

the Amount in Week for October should be 21 but currently I can only perform the calculation over 1 month which gives me 26

Cheers

Brett

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Please find attached file for solution.

Regards,

Jagan.

View solution in original post

5 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try Chart Inter Record functions like Below()/Above()/Before()/After() like this

sum(stock) for Oct / ((sum  sales for Oct) +sum(Sales for Sep) / (count #weeks for Oct) + count(#weeks for Sep))

=sum(stock)/(RangeSum(sum(stock), Above(sum(stock))) / (RangeSum(Count(Weeks), Above(Count(Weeks)))

If above expression not works then try changing Before() or attach sample file.

Regards,

Jagan.

sushil353
Master II
Master II

Hi Brett,

Upload sample application for better resolution.

Sushil

Not applicable
Author

Hi Sushil

See attached document

jagan
Luminary Alumni
Luminary Alumni

Hi,

Please find attached file for solution.

Regards,

Jagan.

Not applicable
Author

Thanks Jagan, works well