Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
lessassy
Creator
Creator

Color on a bar chart based on value (value = date from master calendar)

Hello Everyone,

I'm using the master calendar in my script.

And I used that to display specific value based on weekyear (weeknumber and year)

Recent.PNG

What i want to do is to put in Green the most recent bar in the chart. The most recent one is 20.2018 and i want it to be in different color for comparison aspect.

I know i have to go to background in the expression view

color.PNG

But as i'm a newcomer for qlikview i don't know the right formula to put in order to have the bar chart in blue for the latest (most recent week).

As I previously said I have a master calendar in my script

MasterCalendar: 

Load 

               TempDate as Created, 

               week(TempDate) As Week, 

               Year(TempDate) As Year, 

               Month(TempDate) As Month, 

               Day(TempDate) As Day, 

               YeartoDate(TempDate)*-1 as CurYTDFlag, 

               YeartoDate(TempDate,-1)*-1 as LastYTDFlag, 

               inyear(TempDate, Monthstart($(varMaxDate)),-1) as RC12, 

               date(monthstart(TempDate), 'MMM-YYYY') as MonthYear, 

               ApplyMap('QuartersMap', month(TempDate), Null()) as Quarter, 

               Week(weekstart(TempDate)) & '-' & WeekYear(TempDate) as WeekYear, 

               WeekDay(TempDate) as WeekDay 

And the field of the bar chart  (which represent the expression i used in the form (sum(LossBU))  is

field f.PNG

Anyone can help ?

Thank You

23 Replies
lessassy
Creator
Creator
Author

MaxWeekYear.PNG

I tried but it's not working either.

Maybe it has to with the fact that I use this in the script and not in the variable overviewvariable color.PNG

Janneke
Creator
Creator

if the variable in the script is not working, delete it.

You need to get the expression right. Use a text box to make sure you have everything correct in the set analysis part. Try adding an = after dollar: $(=vMax....

lessassy
Creator
Creator
Author

It worked pretty well.

Thank you

Janneke
Creator
Creator

No problem,

Good luck developing the rest of the application.