Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
Qlik Connect 2025! Where innovative solutions turn your data visions into reality: REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
jldengra
Creator
Creator

How to combine different background colors for dimension values in a Pivot Table

Hello,

Some of my QlikView work has been evaluated as non-professional or amateur because tables did not use different background colors to distinguish different rows or columns grouped by the same value in some dimension, as well as an Excel document allows to be customized with colors.

Is this possible in a QV pivot table ?

I have seen the Chart Properties / Visual Clues options, but they only work for expressions between some upper and lower value, not for dimensions values, and what I need is to distinguish background colors for different values of a dimension.

Is there a way in QV to customizate a table for a better user view giving a different background color for each one of some dimension values ?

Thank you in advance,

J.L.Dengra

9 Replies
christophebrault
Specialist
Specialist

Hi,

In Dimension, you can click on the '+' and can write an expression as background color for dimensions. Then, choose how you want to set colors...

Inscrivez vous à ma Newletter Qlik
DoNotMissQlik- Connect with me on Linkedin
Not applicable

.. right.. and common color functions may look like =if(DimensionValue='xyz',Green()) or if you want to provide more detailed combination of RGB then =if(DimensionValue='xyz',RGB(0,255,0))

jldengra
Creator
Creator
Author

Thank you for your help.

I have tried it, but it fails, it seems not to function properly.

I have set Green() as background for the first dimension value and RGB(220, 220, 130) for the rest, and the full table is filled by RGB(220, 220, 130), Green color appears in the first data line only when scrolling and blinking !

If I change to web view, the Green color never appears, even scrolling.

As you adviced me, I have set the dimension Background property by clicking the '+' and writting an expression like this:

= If (first_dimention = 'First dimension value', Green(), RGB(220, 220, 130))

If I try to set only the first value color, the default bakground persists and it also blinks and fills green at the first line while scrolling.

And when I apply the same Green background for the first dimension value to the rest of dimensions, some of the related lines are shown in green and other in the default background color.

In the first column, Green blinks when scrolling, in the second column, only 4 from the 7 related files and subtotal are Green, and in the third column, only 9 from the 12 related lines and the subtotal are Green.

It seems to missfunction.

Is there any property to make persistent a customized color for a dimension without missfunction?

Not applicable

hmm can you try If (MaxString(first_dimention) = 'First dimension value', Green(), RGB(220, 220, 130)) OR If (only(first_dimention) = 'First dimension value', Green(), RGB(220, 220, 130))

jldengra
Creator
Creator
Author

Neither MaxString nor Only, the result is the same, it misfunctions, with different behaviour depending on the dimension in which the background value is set, and also different in web view.

I begin to believe QV is the most non-deterministic tool I've ever developed with.

Not applicable

I'm experiencing the same issue with QV11 SR1.  Expression works fine in straight table, breaks in pivot table.  Opened a support case, will communicate how we resolve.

Jeff G

christophebrault
Specialist
Specialist

Hi,

Can you share a sample app ?

I'm playing with colors in my pivots and it's working well...

Inscrivez vous à ma Newletter Qlik
DoNotMissQlik- Connect with me on Linkedin
Not applicable

In my case, the pivot table responded correctly I guess by showing the "false" color when I expected true because some of the resulting calculations would result in false if more than one entry existed for a specific record.  The problem had to do with combinations of dimension values that lead to a false do to bad data.

jg

Not applicable

Can you be more specific about your resolution?

I have a pivot table with 2 dimensions with the field called BASE_ORDER_TYPE pivoted to the top:

=IF(BASE_ORDER_TYPE='LAB', RGB(214,99,252),
IF(BASE_ORDER_TYPE='MED', RGB(171,171,88),
IF(BASE_ORDER_TYPE='RAD', RGB(102,194,150),
IF(BASE_ORDER_TYPE='Other',RGB(255,255,179), RGB(255,165,121)))))

There are some dimensions I can use for Rows and the colors for the labes work perfectly and as expected. But when I use other dimensions for the rows then the colors for the dimension labels don't work properly.

Hoping your resonse of "combination of dimension values" and what you did to resolve will help me.