Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Read about the latest Qlik Community enhancements on the Community News blog!
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

Help with variables / weighting them


I do have variables 

D1ar1 up to D1ar5

They have stored values from 1 to 6. I would like to weight them, so I'd like to count all of them for each variable and then multiply the count amount by 0-5 (means multiply by 0 for count of value of 1, multiply by 1 for count of value of 2)

and then get the percentage out of that, so I need to SUM values for specific option (like for 1 or 2 or ... 6) divided by sum of values for all options (from 1 to 6 together)

So its like (imagine, random numbers)
D1ar1 got

40 times value of 1, multiplied by 0 is 0 

2 times value of 2, multiplied by 1 is 2

3 times value of 3, multiplied by 2 is 6


2 times value of 6, multiplied by 5 is 10

So the score is (taking only visible ones) 0+2+6+10, so 18

Lets pretend rest ( D1ar2 ...D1ar5)have score of 20

then 18 (D1ar1 value for all options in variable) / SUM (of all) which is 18 + 20 + 20+ 20 + 20  (98) = 18/98 which is ~18%

for the rest it is 20 / 98 so ~20%

Hope it clarifies what I would like to achieve and you could help me guys. It is easy in Excel but not so easy in Qlik for beginner 

0 Replies