Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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.

1 Solution

Accepted Solutions
Not applicable
Author

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.

View solution in original post

2 Replies
Not applicable
Author

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.

Not applicable
Author

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

Regards