Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

camjvine18
Contributor

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
xufei123
Valued Contributor

Re: Conditional formatting expression not working

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)

    )

)

3 Replies
xufei123
Valued Contributor

Re: Conditional formatting expression not working

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)

    )

)

Highlighted
camjvine18
Contributor

Re: Conditional formatting expression not working

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

xufei123
Valued Contributor

Re: Conditional formatting expression not working

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