Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Total of dimension, if()

Hi guys,

How can I achieve the following:

2 dimensions: number and article

1 expression: sum(weight)

I want to edit the conditional formating of "number". I want it to turn red if the weight > 5, and normal black if it is <= 5

But I do not know how I can tell QV to only sum up the values of one number, and not the tota of the entire table.

Knipsel.JPG

My current conditional format for the text of "number"

=if(

sum(TOTAL Number {$<Jaar={$(=only(Jaar))}>} Weight) > 5,

rgb(231,0,24))

Can somebody help me out?

Cheers,

Zipke

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

This should do it:

if(sum(TOTAL <Number> {$<Jaar={$(=only(Jaar))}>} Weight) > 5, rgb(231,0,24))


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

This should do it:

if(sum(TOTAL <Number> {$<Jaar={$(=only(Jaar))}>} Weight) > 5, rgb(231,0,24))


talk is cheap, supply exceeds demand
Not applicable
Author

I used your formula as the calculated dimension of "number" instead of the normal "number", but it is giving me the error: //error in calculated dimension..

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You're not supposed to use it as calculated dimension, but as expression for the Text Color of the dimension.


talk is cheap, supply exceeds demand
Not applicable
Author

Yes of course, stupid mistake. I even explained it in the opening post..

Thanks a lot!