Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Noobforever
Contributor
Contributor

Weighted average for a column

Weighted average of lifetime 
 

Hi everyone,   I wanted to calculate weighted average of Lifetime the table given below

And the weights is the total count of each type and subtype. How do I calculate this in the chart (front end).

Want to calculate weighted average for each type and each subtype and display it in a table

Have attached the csv below

Labels (4)
6 Replies
ckarras22
Partner - Creator
Partner - Creator

Hello,

(fom a frozen sample of your file)sample.jpg

Noobforever
Contributor
Contributor
Author

I need to apply something like this 

A= lifetime * count

B= sum(a)

Weight average= B/count

 

1 .So each value of lifetime is multiplied by count of that particular type and subtype

2.add the products 

3. Divide the sum of products by count

 

ckarras22
Partner - Creator
Partner - Creator

Hello

for Weight average= B/count the count is sum(count)? if not which count value should be taken?!?

In case that count is the number of lines for each Type/Sub-type pair, then what i sent above is what you want.

Noobforever
Contributor
Contributor
Author

Yes it is sum(count) for each type and sub-type

ckarras22
Partner - Creator
Partner - Creator

then sum(Count*[Life(in months)])/sum(Count) is the formula for 

"Want to calculate weighted average for each type and each subtype and display it in a table"

Noobforever
Contributor
Contributor
Author

I am attaching expected result please refer. I have to use aggr I guess

Fo andriodFo andriodfor touch in andriodfor touch in andriod