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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
MPS
Contributor III
Contributor III

Color coding for Bar chart

Dear All,

I am trying to add different color to the bar chart which is by Week ending. Need 

Dimension -- =WeekEnd([Estimated Pre-Approval Date])

Help required -- Need the chart to show in different color for all previous weeks weeks. Current week is 03/20/2021, so all week before to show a different color. I tried with one expression under 'Colors & legend', but didn't workout. could you please help.

tried expression, but failed --- =if(WeekEnd([Estimated Pre-Approval Date])<'Today', 'pink', 'blue')

 

MPS_0-1616054989034.png

 

 

Labels (1)
1 Solution

Accepted Solutions
NitinK7
Specialist
Specialist

Select color->custom->By dimension

an write exp -if(WeekEnd([Created Date])<Today(),Red(),Blue())

NitinK7_0-1616065868542.png

NitinK7_1-1616065998249.png

 

 

 

View solution in original post

8 Replies
agigliotti
MVP
MVP

Hi @MPS ,

Maybe this:

=if( WeekEnd([Estimated Pre-Approval Date])<Today(), rgb(255,192,203), blue() )

I hope it can helps.

Best Regards

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
MPS
Contributor III
Contributor III
Author

Thank you for the quick response, but the bar chart all went blue. Do i have to add any single quotes for any of these fields. 

agigliotti
MVP
MVP

you have to check the date format, try:

=if( num(WeekEnd([Estimated Pre-Approval Date]))<num(Today()), rgb(255,192,203), blue() )

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
MPS
Contributor III
Contributor III
Author

Sorry, this didn't work either 😟. Do you need the expression for you to check and validate, not sure if that could be the reason. 

below are my Qlik color codes, 

Blue - 080047
Pink - e30d75

 

 

NitinK7
Specialist
Specialist

Select color->custom->By dimension

an write exp -if(WeekEnd([Created Date])<Today(),Red(),Blue())

NitinK7_0-1616065868542.png

NitinK7_1-1616065998249.png

 

 

 

agigliotti
MVP
MVP

yes, could be useful to look at your "Colors By expression"...

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
MPS
Contributor III
Contributor III
Author

Thanks a ton, this actually worked

MPS
Contributor III
Contributor III
Author

Thank you so much for your kind help. You have always been prompt & first person to respond. Much appreciated 🤗