Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Chart Background Color depending on date

Hi all

I have a bar chart that give me data for the last 10 days (last day on the right). Last 10 days are selected thanks to set analysis (OK, it works)

I would like to have all the days pertaining to the same week as the last day to be in orange, values for other days in grey.

It works, no problem

The only problem is that when I add the condition on the bar colors, my set analysis on 10 days is not taken in account and Qlikview displays a lot of days, not only the last 10 (see images below)

Any idea on why I have this behavior?

Thanks in advance

Hub

Without colors : 10 days thanks to set analysis

Graph without colors.png

With Colors : lots of days but the last days are in orange because they belong to the same week

Graph with colors.png

Formula used in Graph Properties > Expression > Background Color > Definition :

= if(Week(PeriodDate.Date)=Week($(vReportDate)), cOrangeStandard, cVeryLightGrey)

PeriodDate.Date is the date on the Y axis...

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try

= if( only ({<YourSetExpressionToLimitTheWeeks>} Week(PeriodDate.Date))=Week($(vReportDate)), cOrangeStandard, cVeryLightGrey)

View solution in original post

2 Replies
swuehl
MVP
MVP

Try

= if( only ({<YourSetExpressionToLimitTheWeeks>} Week(PeriodDate.Date))=Week($(vReportDate)), cOrangeStandard, cVeryLightGrey)

Not applicable
Author

Thanks swuehl!

First time I use the ONLY aggregation function, it took me some tries but finally got there thanks to your hint 🙂