Dear QlikView users,
I am looking for the definition, that will allow me to show recent 12 bars in different color that rest of the bars. I know I can define color, after clicking "cross" next to my expression, but I have no idea what I should put there. Anybody knows?
Maybe another idea- Could I use bar offset to show recent 12 months?
Try this, not tested but should work
=If(CalendarMonth < (max(CalendarMonth)-12),LightGreen(), LightRed())
Should Color the first 12 Green and all the Others Red, cahnge Colors to your needs 😉 (I prefeer Using the rgb() function becasue you're more flexible!)
Here a suggestion for Baroffset (looks nice in Combination with the Colors)
Just paste in the "Baroffset" Part:
=If(CalendarMonth < (max(CalendarMonth)-12),1,0)
In the same place (by clicking "cross" next to the expression -> Background Color) try to write this:
Instead of my "Date" field use yours.
This should work fine for you:
Instead of "Date" field i wrote "makedate(CalendarYear,CalendarMonth)"
Unfortunately it doesn't work - everything turns to red. Fortunately expression suggested by Milda works perfectly. Could you elaborate more on bar offset option? Do you have another examples? Thank you very much!
I'm sorry for that. I forgot to mention that this is just the basic Idea how it works, Milda did a great Job coding it right for your case! Now you can use this Statement for the bar offset as well. (I try to make this one correct)
What I've done is simply replacing the colors with 1 and 0 (1 for Offset and 0 for no Offset).
One Tip from me: Offset doesnt look great and also decreases the charts readability, I suggest using the "Show Value" 2 lines below "Bar offset". The statement is the same as above!
Edit: Please let me know if "Show vale" and/or "bar offset" worked and give Milda the "Verified Answer"