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

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

I believe the keyword ALL has been depricated, and the preferred form is now {1} TOTAL.  That gives us more of a hint how these might be combined.  I'm not sure if this is exactly what you're looking for, but I'd think something like this:

sum({1<NAMEPLATE=E(),COUNTRY*={'CANADA'}>} total <Period> iPSI10*WEIGHT)/
sum({1<NAMEPLATE=E(),COUNTRY*={'CANADA'}>} total <Period>        WEIGHT)

View solution in original post

13 Replies
Not applicable
Author

I suppose you have a weigth in your file, so create an expression :

Sum(  Value * Weight) / Sum(  Weight)   to calculate a weighted-mean

Not sure it's what you want to achieve.

JJ

Anonymous
Not applicable
Author

My database has a lot of customers who have a different number of respondents by month.

In different programs use a command weight. Help me create this expession.

Regards,

Not applicable
Author

Hi Vovan4ik

I don't understand.

Please could  you precise the structure of your data and the chart you want to display

JJ

Anonymous
Not applicable
Author

How can I apply a weight to the data that I include in my analisys?

I want to compare the value for a selected Nameplate (Val1, or Val2, ...) to combined weighted value for other Nameplates.

I have variable Weight.

Please find my attached file.

Thank you in advance.

johnw
Champion III
Champion III

Perhaps this for the combined weighted value for other nameplates?

sum({<NAMEPLATE=E()>} iPSI10*WEIGHT)

/sum({<NAMEPLATE=E()>} WEIGHT)

Anonymous
Not applicable
Author

Hi John,

Could you help me to add your expession to mine

avg(ALL<Period> IF (COUNTRY='CANADA', iPSI10)) ?

Thank you,

johnw
Champion III
Champion III

I believe the keyword ALL has been depricated, and the preferred form is now {1} TOTAL.  That gives us more of a hint how these might be combined.  I'm not sure if this is exactly what you're looking for, but I'd think something like this:

sum({1<NAMEPLATE=E(),COUNTRY*={'CANADA'}>} total <Period> iPSI10*WEIGHT)/
sum({1<NAMEPLATE=E(),COUNTRY*={'CANADA'}>} total <Period>        WEIGHT)

Anonymous
Not applicable
Author

When I tried to use your expression in my qv,  all my expression was red. I updated my qvfile. I’m a new in Qlikview.

Could you explain what does it mean command E() or try toadd it in my file.

I appreciate it.

johnw
Champion III
Champion III

I was able to cut and paste it in as a third expression, and it worked with no modification.  See attached.  I can't say whether or not the results are correct, but it returns data.  What version of QlikView are you using?  The expression won't work in versions 8 or lower.  That's all I'm thinking of.

E() means "excluded".  If you select a specific nameplate, that gives you all other nameplates.  That was my interpretation of "combined weighted value for other Nameplates".