2 Replies Latest reply: Jul 26, 2012 10:28 AM by Alfredo González

# calculating totals in  pivot table

hello everyone, i have  an issue with QlikView.

i have a pivot table with the next expression:

if(Column(2) >= 1,(SUM(Venta * REBATE_NORMAL))/1000,0)

and this brings me the next results:

this results are correct except for the total. it should give me this total 43.41.

is there a way to qlikview calculate the total correctly in a pivot table. i know  you can change the totals in a straight table but in this particular case its need to be a pivot table.

thanks in advance

Best regards.

• ###### Re: calculating totals in  pivot table

An if condition in this case computes at row level. Ie., if column(2) for total row is >1 then sum is applied. But i guess you would need sum of rows. For that try using aggr() function. It goes something like this:

sum(aggr(if(expressoin2>1,sum(Venta * REBATE_NORMAL),0),dim1,dim2))

Kiran.

• ###### Re: calculating totals in  pivot table

Kiran, Thank you very much it worked like a charm.

Regards