Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'd like to denote a change in data collection method in a time series chart by changing the color of the line. Ideally I would've liked to create a vertical reference line (or bar) but that doesn't seem possible from what I've seen.
My X axis =WeekStart(Date)
I am able to get the color expression to work if I change the axis to just Date and use below, but the data needs to be represented by week.
=If(Date>='05/06/2023','color1','color2')
But this doesn't work with WeekStart. Is there a way to do this? I am open to alternative suggestions with how to best denote a change in data collection methods in this time series.
I suggest to create the week already within the calendar. Further you may there also creating a running week-number and/or an week-offset against today() and/or flags for past/future dates and/or if it goes against reload-related static values like today() even setting the colors there (a color is just a number).
Doing all such stuff within the UI is possible but doesn't makes it easier (mostly the opposite will happens).
Hey Michelle,
You can try to use the WeekStart() function within a color set expression in Qlik Sense by using it in an if statement.
Here’s an example:
=If(WeekStart(Date)>='05/06/2023', 'color1', 'color2')
This expression will change the color of the line to 'color1' if the week start date is greater than or equal to '05/06/2023', otherwise it will be 'color2'
Hi,
It seems to work for me. If you could post some example dates and a screenshot of where it's not working, it would help.
This doesn't seem to work for some reason. I've used
=If(WeekStart(Date)>='05/06/2023', 'red', 'blue')
I suggest to create the week already within the calendar. Further you may there also creating a running week-number and/or an week-offset against today() and/or flags for past/future dates and/or if it goes against reload-related static values like today() even setting the colors there (a color is just a number).
Doing all such stuff within the UI is possible but doesn't makes it easier (mostly the opposite will happens).
Thanks, Marcus. I made a Week Start field in my Load Editor Calendar and then using the below worked perfectly:
=If([Week Start]>='05/06/2023', 'color1', 'color2')