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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Nested IF in Bar Chart Color Conditioning

Greetings!

I have an issue with an nested IF in a bar chart color conditioning...

The rules are:

=< 10% - Green

Between 10 and 15% - Yellow

> 15% - Red

Pretty simple... but when I write it down the code:

IF(

     (sum(if(Aging > 15, USD)) / sum(USD)) <= 10, RGB(100,255,0),

                    IF(

                  sum(if(Aging > 15, USD)) / sum(USD)) > 10, RGB(0,255,255),

                          IF(

                                                            sum(if(Aging > 15, USD)) / sum(USD)) <= 15, RGB(0,255,255),

                                                                           IF(

                                                                                               sum(if(Aging > 15, USD)) / sum(USD)) > 15, RGB(255,0,0)

                           )

                 )

     )

)

It just doesn't work... can anyone see the flaw in the nesting?

The QV debugger is not very helpful...

Thank you all in advance!

1 Solution

Accepted Solutions
Not applicable
Author

Corrected below

If((sum(if(Aging  > 15, USD)) / sum(USD)) <= 10, RGB(100,255,0), IF(sum(if(Aging  > 15, USD)) / sum(USD)) > 10, RGB(0,255,255), IF(sum(if(Aging  > 15, USD)) / sum(USD)) <= 15, RGB(0,255,255), IF((sum(if(Aging  > 15, USD)) / sum(USD)) > 15, RGB(255,0,0)) )

View solution in original post

3 Replies
Not applicable
Author

Corrected below

If((sum(if(Aging  > 15, USD)) / sum(USD)) <= 10, RGB(100,255,0), IF(sum(if(Aging  > 15, USD)) / sum(USD)) > 10, RGB(0,255,255), IF(sum(if(Aging  > 15, USD)) / sum(USD)) <= 15, RGB(0,255,255), IF((sum(if(Aging  > 15, USD)) / sum(USD)) > 15, RGB(255,0,0)) )

Not applicable
Author

Thank you so much!

Stefan_Walther
Employee
Employee

Hi,

maybe this may help you in the future:

http://www.qlikblog.at/464/tool-creating-nested-ifstatements/

Regards

Stefan