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

Calculation in pivot table

why the calculation in pivot table is not accurate it give a wrong number, but in straight table it's right !!

01.png02.png

1 Solution

Accepted Solutions
preminqlik
Specialist II
Specialist II

hi there,

It depends on what is the level of your aggrigation,

use the following exp

=sum(aggr(

((sum(QTY) + (vQty2)) * (sum([Unit Price])* (1+vSales2/100)))

-

(

((sum([Unit Cost]) * sum(QTY))) * (1+vCost2/100)

)

,

[Customer Name],

[SOP Number],

Item_Description,

[S_Location Code]

))

View solution in original post

6 Replies
MK_QSL
MVP
MVP

Provide sample application or sample data to work...

Anonymous
Not applicable
Author

qlik example

Anonymous
Not applicable
Author

I put it in last comment.

regards.

MK_QSL
MVP
MVP

There are so many information and objects in your qvw. We need to have only those two where you are trying to match!

preminqlik
Specialist II
Specialist II

hi there,

It depends on what is the level of your aggrigation,

use the following exp

=sum(aggr(

((sum(QTY) + (vQty2)) * (sum([Unit Price])* (1+vSales2/100)))

-

(

((sum([Unit Cost]) * sum(QTY))) * (1+vCost2/100)

)

,

[Customer Name],

[SOP Number],

Item_Description,

[S_Location Code]

))

Anonymous
Not applicable
Author

Thanks a lot.