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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
simona_un
Contributor
Contributor

Weighted average (sumproduct)

Hi,

I have this challenge where I would like to calculate the weighted average of person by exposure across the year and package:

simona_un_0-1719578223305.png

Any idea how to solved it?

 

Thanks 🙂

Labels (1)
1 Reply
marksouzacosta
MVP
MVP

Hi @simona_un,

I believe the correct Excel expression is this one right?
SUMPRODUCT(D3:D12,C3:C12)/SUM(D3:D12)

If so, this is how you can do in Qlik:

How I have loaded your data:

LOAD
[Policy],
[Count of person],
[Exposure],
[Package],
[Year]
FROM
[lib://DataFiles/Weighted average.xlsx]
(ooxml, embedded labels, table is Sheet1)
;

And the expression on a KPI chart:

=Sum([Exposure] * [Count of person])/Sum([Exposure])

marksouzacosta_0-1719610473809.png

Is this what are you looking for?

Regards

Mark Costa

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com