Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Create nested if statements in color by expression

I created a positive-negative bar chart and I would like to implement 2 colors: green for positive values and red for negative values for example.

Positive negative bar.jpg

I have used two measures to obtain this chart a Min(value) and a Max(value), so when I insert a color expression I have something like this:

=If(Min(Value) < 0, Green(), Red()) but I would like to create a nested if statement something like:

=If(Min(Value) < 0, Green(), Red(),

     If(Max(Value) > 0, Green(), Red())

But I'm not sure if I can use this approach in this case cause is not working. Any ideas how to create something like this?Thanks,

Capture1.PNG

10 Replies
Anonymous
Not applicable
Author

I think you are right Ok I will set a color for each value and see how it goes.