Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Simple example : let's say I have a data set with only one column containing colors (red, yellow, blue for instance).
I want to display a table containing :
-the number of occurence of each color
-the relative proportion of each color to the red one
ex.
Blue
Red
Red
Blue
Yellow
Blue
would give me
COLOR| Nbr occ | Relative to red
Red | 2 | 1
Yellow | 1 | 0,5
Blue | 3 | 1,5
For the relative proportion to red I tried something like
=count(Color)/count({1 <Color={"Red"}>} Color)
but it gives 0 for the Yellow and Blue row.
What am I doing wrong?
Yes this works! Thanks!
Try this expression
Count(colour)/Count({$ <colour={'Red'}>} TOTAL colour)
No idea. It works fine for me. See attached qvw.
Make sure to use the exact case sensitive field name. COLOR, color and Color are three different fields to Qlikview.
Yes this works! Thanks!
My point was being able to calculate the total number of Reds for each row, the solution suggested by Alessandro works
Doesn't work :
count(Color)/count({1< Color={'Red'}>} Color)
Works :
count({$ <Color={'Red'}>} TOTAL Color)
Could you please mark the question as answered? Thanks
Oh, you wanted that in a straight/pivot table. Yes, then all you need to do is add the total keyword.