Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

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

Re: Color cell background according to field selection

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


11 Replies
dennisnet
Valued Contributor III

Re: Color cell background according to field selection

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

Color cell background according to field selection

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.

dennisnet
Valued Contributor III

Color cell background according to field selection

I see.

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

Not applicable

Re: Color cell background according to field selection

It really simple :

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

chauhans85
Esteemed Contributor

Re: Color cell background according to field selection

click on + before expression

-> backgroundcolor->

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

see the attached file

hope this help

Not applicable

Re: Color cell background according to field selection

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

dennisnet
Valued Contributor III

Re: Color cell background according to field selection

Take a look at the attached file.

Is this what you are looking for?

Not applicable

Re: Color cell background according to field selection

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

Not applicable

Re: Color cell background according to field selection

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

Community Browser