Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Weight data

Hello,

How can I weight data? If anybody knows, please send me an example or explanation.

Thanks

13 Replies
Anonymous
Not applicable
Author

I'm using version 11.  The expression returns data. QV underlines all expression, is it correct? The result is not correct, but close to. Why did you use sum instead avg? What's it COUNTRY* and 1<NAMEPLATE?

Thanks in advanced

johnw
Champion III
Champion III

I'm using version 10 SR3.  It doesn't underline the expression on my computer.

I'm using sum because you asked for a weighted average, and that's how you calculate a weighted average.  For example:

Value  Weight
5      2
20     1

unweighted average = avg(Value) = 12.5
weighted average = sum(Value*Weight)/sum(Weight) = 10


COUNTRY*={'CANADA'} is the set analysis equivalent of if(COUNTRY='CANADA',...)

1 is set analysis for "all data"

< is the opening bracket for a set

You're getting confused by syntax.  Go look up the syntax for set analysis.

Anonymous
Not applicable
Author

Thank you so much for your help.

Anonymous
Not applicable
Author

Hi John,

You were very helpful last time. How can I do weighted calculation in %?

I usually do:

Count({<[qID_3_Task completion]={'Yes'}>}[qID_3_Task completion])/

Count(TOTAL<MYear>[qID_3_Task completion])

I have variable WEIGHT, but I don't have any thoughts how to use it.

Please advise your idea.

Regards,