Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Conditional formatting expression not working

Hi

Why does this not work, Red for negative and Green for positive, pretty simple.

if(Sum([Ontime / breach mins])>0,Green(),

if(Sum([Ontime / breach mins])<0,rgb(255,110,110)))

Capture 2.png

1 Solution

Accepted Solutions
NZFei
Partner - Specialist
Partner - Specialist

Expression is different from colour expression. The current setting is not wrong if you mean it.

Otherwise change the colour settings to

if(Sum({<Category={'Source'},Status-={'N/A'}>}[Ontime / breach mins])>0,

    Green(),

    if(Sum({<Category={'Source'},Status-={'N/A'}>}[Ontime / breach mins])<0,

        rgb(255,110,110)

    )

)

View solution in original post

3 Replies
NZFei
Partner - Specialist
Partner - Specialist

Expression is different from colour expression. The current setting is not wrong if you mean it.

Otherwise change the colour settings to

if(Sum({<Category={'Source'},Status-={'N/A'}>}[Ontime / breach mins])>0,

    Green(),

    if(Sum({<Category={'Source'},Status-={'N/A'}>}[Ontime / breach mins])<0,

        rgb(255,110,110)

    )

)

Anonymous
Not applicable
Author

Thank you, so I see that I need to use the same expression in the data area for the appearance.

NZFei
Partner - Specialist
Partner - Specialist

Not necessarily Cam. It really depends on how you want to colour the chart.

For example you can have sales by month for the bar chart, and the colour is defined as if the sales is greater that last year, shows in green, otherwise show red. That is why I said "The current setting is not wrong if you mean it."

I think you have understood it now so it is good