Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Color cell background according to field selection

Hi QVers,

I tried to find an answer in other discussions but nothing applied in my case.

I have a field 'Date', and a Pivot Table used as a calendar (expression = 'Date'). But now I would like to change the background color according to the selection in the field, i.e. :

if 'Date' in FieldSelection('Date'), green,

else, white

I can't find a way to do it without set analysis and since I ahev no aggregation, can't use it...

If someone has a good idea, thanks in advance.

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

that's exactly what I wanted, and with a little modification, it works perfect.

I don't think the expression:

=day(max(datefield))

is useful. It doesn't make any sens for me and when I put it in a textbox it doesn't show any result (maybe I'm missing something). But anyway, it works fine without it.

Then if I want your process to function, I have to change the end of expression for background color and text color and add a superior sign:

=IF (IsNull(weekday),white(),If(count(Datefield)>=1, Green()))

Then it works well.

Many thanks,

benetche


View solution in original post

11 Replies
Anonymous
Not applicable
Author

You can add this color expression to you expression by clicking on the little plus infort of your expression:

expr.JPG

Or you could use the color settings on the 'Visual Cues' tab

Set Normal to green and Upper and Lower to white, and fill in the right field name. (this only works if you select 1 value)

Good Luck,

Dennis.

Not applicable
Author

Yes, I know where to set a background color expression, the problem is to find a correct expression.

And I want to be able to have many dates selected.

So as soon as some random dates are selected (through an other object), I want the selected dates background to turn green on the pivot table.

And the expression I wrote previously doesn't even exist. It was just to give an idea of what I want.

Anonymous
Not applicable
Author

I see.

How does your pivot looks like? Can you share it?

Not applicable
Author

It really simple :

day of the week on lines and week number on columns. See attached.

SunilChauhan
Champion
Champion

click on + before expression

-> backgroundcolor->

if(GetFieldSelections(Date),Green(),white())

see the attached file

hope this help

Sunil Chauhan
Not applicable
Author

I did try it, but hopelessly it doesn't work...

Maybe I'm missing something. Just to be sure, as shown on the picture in previous message, my pivot table is set as following:

dimension 1 : day of the week

dimension 2 : week number

expression : date

Anonymous
Not applicable
Author

Take a look at the attached file.

Is this what you are looking for?

Not applicable
Author

I can't open your file, no more recovery allowed...

Not applicable
Author

Can you explain what you did without any Qlikview document? (I'm on personal edition, so I'm no more able to open others .qvw).

Thx