Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
ValeriaBonini
Partner - Creator
Partner - Creator

weighted average

Hi everyone, i have the following issue:

In my pivot table, i have:

PRODUCT_NAME     PRODUCT_PRICE    QTY_DELIVERED

AAA                                12                                   1

AAA                                17                                   3

BBB                                15                                   4

 

for each product name I have a lot of prices, and I would like to have  a new field with the avg priced weighted for the qty delivered. 

How can I obtain this?

 

PRODUCT_NAME     PRODUCT_PRICE    QTY_DELIVERED     AVG_PRICE

AAA                                12                                   1                                    15,75

                                         17                                   3

BBB                                15                                   4                                   15

1 Reply
Or
MVP
MVP

For your example, it looks like this would be something along the lines of:

Sum(total <PRODUCT NAME> PRODUCT_PRICE*QTY_DELIVERED) / Sum(total <PRODUCT_NAME> QTY_DELIVERED)