Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Assign Color Condicional Value

Dears,

I would like to assign differents colors to my expresions (in a pivot table) depending of the week, i.e. past and future. For instance, if we are currently in week 48 and I have received US$300 in week 46, US$100 in week 47, however I expect US$200 in week 48, US$500 in week 49 and US$50 in week 50 (as per below customer ABC), I would like the first two values in red (past) and the values for weeks 48, 49 and 50 in blue (present & future).

How can I do that??.

Many thanks in advance.

Customer Name2010-462010-472010-482010-492010-50
IMPORTER ABC$ 300$ 100$ 200$ 500$ 50
HAPPY TRADING CO$ 40$ 150$ 50$ 100$ 250

Mauriccio

5 Replies
Not applicable
Author

Hi Mauricio

try with chart properties - expression

and after expand your express and set background color

Ric.

googel84
Partner - Creator III
Partner - Creator III

I would suggest you to set your expressions' Backgroung Color with an expression based on if function. Type your if expression under: Chart Properties -> Expression tab -> click on + signal beside the expression to modify -> double click on Background Color.

The problem with this solution is that you'll colour also column headers!!

Take a look to one of my post

http://community.qlik.com/forums/t/35563.aspx

googel84
Partner - Creator III
Partner - Creator III

Hi mconcha, please provide me with your Background Colour function.

P.S. I kindly ask you to post your question/answer on your own post and, by the way, remember to set my answer as verified.

Thanks

Not applicable
Author

Hi !!!,

Good day.

This is the one.

Normal 0 21 false false false MicrosoftInternetExplorer4

=If(Week(Today()) > Week, Green(), Yellow())

All the values in zero or null, do not apply. The rest are all ok.

Regarding your PS, I will do. However I don't know how to verify.

Many thanks.

Mauriccio

googel84
Partner - Creator III
Partner - Creator III

Hi, I tried something similar to what you've done and everything is working fine with zero values.

I just created an inline table to simulate your data. I used two fields (F1 and F2) and put them into a pivot: F1 vertically while F2 horizontally, as I think you did Customer Name and Week.

The expression I used is the following:

if(F2 = 1,green(),if(F2 = 3,blue(),yellow()))

Actually, with null values I see that background formatting doesn't apply.

So my suggestion is to, if you think it's right for you, disable Suppress Zero-Values (tab Presentation).

P.S.: To verify an answer just click on Verify Answer button on the top-right corner of each answer you receive.