Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
saurabh5
Creator II
Creator II

Pivot Table (weighted Avg) issue.

Hello All,

I am trying to create a pivot table in QlikView and perform a weighted average calculation, I have 3 dimensions(AREA, AREA 2, PRODUCT CODE) while two metric fields (RATE and Factor), I am trying to get the value in F14 cell (green colored ) which is basically derived by sum(Rate*Factor)/  sum(Rate).  I tried using Aggr and avg function  but somehow not able to get the right value.

Attached is the sample data set I used for the below pivot.  Thanks for the help !

2 Replies
Anil_Babu_Samineni

I haven't see any difficult in your expression, What are you getting when you use same as your expression

Or else, Try this way

Avg(Aggr((Sum(Rate*Factor)/Sum(Rate)), AREA, [AREA 2], [PRODUCT CODE]))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
settu_periasamy
Master III
Master III

Hi saurabh,

may be try this..

if(Dimensionality()=3,sum(factor),
Sum(TOTAL<[AREA 2]>Rate*factor)/Sum(TOTAL <[AREA 2]>Rate))

Capture.JPG