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

Chart conditional colour formatting

I am attempting to have a default bar chart coloured.

When a User initially opens the Dashboard, the SLA Entire Risk Engine batch details will appear and where minutes are negative, bars should be red and where minutes are positive bars should be green (will change colour for colour blind people another time).

The code works fine if I don't use a default selection but when I introduce a default selection the positive minutes red instead of green.

If((isnull(Milestone) AND Min({<System={'Source'},Milestone={'Entire Risk Engine batch'},Status={'Breach'}>} Minutes))<0,

    rgb(255,110,110),

If((isnull(Milestone) AND Max({<System={'Source'},Milestone={'Entire Risk Engine batch'},Status={'Breach'}>} Minutes))>0,

    Green(),

If(Min({<System={'Source'},Status={'Breach'}>} Minutes)<0,   

    rgb(255,110,110),

    Green(),

    )))

Capture.PNG

1 Solution

Accepted Solutions
Ralf_Heukäufer
Partner - Creator III
Partner - Creator III

Here is your original app with my changes in the one bar chart visualisation:

View solution in original post

25 Replies
Ralf_Heukäufer
Partner - Creator III
Partner - Creator III

Hello Cameron you can use

if(If(isnull(Milestone),

    Min({<System={'Source'},Milestone={'Entire Risk Engine batch'},isExclusion={0}>} Minutes),

    Min({<System={'Source'},isExclusion={0}>} Minutes))<0,rgb(255,110,110),green())

instead of your declaration.

sunny_talwar

I have not dug deeper into your qvf file, but is there a reason your use Min < 0 and Max > 0 check? Why not both mins or both maxs?

Capture.PNG

Anonymous
Not applicable
Author

That fixes the default selection but as soon as another Milestone is selected than the problem persists.

Anonymous
Not applicable
Author

Cos all other variations have not worked and when I change to both Min then I still have the problem.

Anonymous
Not applicable
Author

Apologies, I was wrong in my statement, this works.

Anonymous
Not applicable
Author

and spoke to soon again as for some reason I have a problem on the chart next to it now

Anonymous
Not applicable
Author

I have not fixed it and it works on both charts.

Anonymous
Not applicable
Author

While I have fixed one issue I still have another issue on this chart. I thought this expression would only include dates where Is exclusion = 0 but it still shows dates even though I have this exclusion. If I select the isExclusion filter the chart does not change either. Capture.PNG

If(isnull(Milestone),

Min({<System={'Source'},Milestone={'Entire Risk Engine batch'},isExclusion={0}>} Minutes),

Min({<System={'Source'},isExclusion={0}>} Minutes))

shraddha_g
Partner - Master III
Partner - Master III

Try unchecking "Show zero values"