Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
For a client of mine I've built a simple grouped bar chart. I've got a "Sum(Amount)" displayed by hour, grouped by Date.
I've then set the bar chart up so that it colors each day alternately in two colours, so the days become easy to recognize.
But while checking the chart, I've come upon the following: two dimension values next to each other are getting the same color.
Both date values are distinctive values, so I don't understand why Qlik Sense wouldn't just alternate the color.
Any help with some clarification is appreciated.
I've attached a screenshot of the bar chart where you can see how colors should alternate, but for dates 21/12/2025 and 22/12/2025 it does not alternate.
This is Qlik Sense Server November 2024 Patch 12 (14.212.19)
Hi @TPoismans
I would not recommend to use it in this way. I think it is better if you set the colors using an expression. You will always have more control over them. You can try for example this one, in my end seems to work:
=if(mod(Floor(Date) - Min(TOTAL Floor(Date)), 2) = 0, RGB(255,0,0), RGB(0,0,255))
Let me know if it helps you.
Kind Regards
Daniel
Hi @TPoismans
Could you, please, indicate how are you creating the alternate colors? Are you using an expression to accomplish it?
Kind Regards
Daniel
Did you try Combo Chart?
You can specify the colours per bar
I'm just using the built-in feature of the bar chart
Appearance => Colors and legends => Switch to Custom => Set it to "By dimension" and set it to Dimension1 (My date dimension).
Color is set to a 2-color palette I defined in the theme
I don't need every bar in a different colour, I wanted to have the days alternate in colour. It seemed to work, except on the part shown in the screenshot.
I want to know why it doesn't alternate between the 21/12 and 22/12 as it might pose a problem in other calculations if there's an issue with the values of the date.
Hi @TPoismans
I would not recommend to use it in this way. I think it is better if you set the colors using an expression. You will always have more control over them. You can try for example this one, in my end seems to work:
=if(mod(Floor(Date) - Min(TOTAL Floor(Date)), 2) = 0, RGB(255,0,0), RGB(0,0,255))
Let me know if it helps you.
Kind Regards
Daniel
Your suggestion does solve my issue, so I'll mark it as the solution.
Thank you very much!
Though I do wonder, why do you recommend not using the built-in feature the way I did? I would expect the color by dimension giving a different color to each value of the dimension, thus resulting in alternating the colors.
I've since found multiple dates where the color doesn't alternate, so I'm wondering if there's an issue with my date-data or if it's something in the way the coloring per dimension (value) is applied?