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: 
blaise
Partner - Specialist
Partner - Specialist

Color code rows in dimension value

Hello

I would like to color code the background of the dimension values in a straight table, somewhat like the "strip every" function but for every new value. With the following example table;

Dimension1Dimension2Expression
A1
A2
A3
B1
B2
C1
D1
D2
D3
D4

I would like the background color of Dimension1 to be grey for the values A, white for B, grey for C, white for D and so on.

Is this possible? I have tried with the above() function but that doesn't seems to do the trick. The values of Dimension1 in the real data is not as simple as A-Z.

31 Replies
anlonghi2
Creator II
Creator II

Hi Blaise,  my suggestion worked ?

blaise
Partner - Specialist
Partner - Specialist
Author

The fieldIndex() function doesn't return a sorting that can be used - as explained earlier in the thread.

Not applicable

Since this is 'not answered', maybe helpfull to some other people.

In the 'Background color' box, type in something like the following:

=if([Dimension 1]='A' or [Dimension 1]='C'

    ,rgb(255,255,255)

    ,rgb(224,224,224)

)

you can add as many values as you want, by adding 'or' statements.

blaise
Partner - Specialist
Partner - Specialist
Author

This is not a solution that works, as explained a few times in the thread. Please read the full thread before posting.

Anonymous
Not applicable

Instead of using a Dimension, use an expression instead then you can use a simple if statement in the expression background color.

=if([Dimension 1]='A',green(),blue()) then just move the column around to where you normally place the dimensions.

Not applicable

Hi Johan,

I would be really interested in knowing whether you've managed to get it working with a custom sort and whether it persists when you make selection changes that influences the table records?

Regards,

Sean

blaise
Partner - Specialist
Partner - Specialist
Author

Well Thomas Duvivier's last suggestion was indeed working but with a variable that is calculated for every change in selections. Not a solution I was hoping for so I dropped it in the end.

ThornOfCrowns
Specialist II
Specialist II

This approach has been rejected several times in this thread by the OP.

Not applicable

Ah ok I see, thanks for the reply.

Anonymous
Not applicable

I had a similar requirement with the straight table where I wanted to highlight only that dimension value which user selects form in the list box. Achieved this using match function along with GetFieldSelections.