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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Weighted average

Hi All, I have the following problem: my information drills down in country-region-Channel. I have the variable "Physical Distribution" per country-region-channel but i want to see that variable in just for "Country". It must be an average, but a weighted average (weighted by Volume). How can I code that?

example.

Chile -> Santiago --> Traditional : physical distribution = 90 , Vol = 200.000

Chile -> Santiago --> H & S : physical distribution = 56 , Vol = 100.000

Chile -> Santiago --> Modern : physical distribution = 80 , Vol = 20.000

Physical Distribution for Santiago : ( 200.000/320.000 * 90 + 100.000/320.000 * 56 + 20.000/320.000 * 80)

5 Replies
Not applicable
Author

Hi,

Please, look into an attached example.

I hope it will help you.

Kind regards,

JTPro

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Try this:

sum(PD * Volume) / sum(Volume)

cheers,

Ask me about Qlik Sense Expert Class!
Not applicable
Author

Thank Janusz, your example was very helpful. I adapted it and everything seems to be working right.

Not applicable
Author

I'm trying to accomplish something similar, but with a weighted time average and I just can't manage to get it to work. I got data with the structure like the attachment and I want the weighted average waiting time per skill. I've tried using both a <TOTAL> and an AGGR, anybody got any ideas?

Not applicable
Author

Figured out the problem was in my set analysis and not in my formula, <TOTAL> worked fine.