Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
Not applicable

Shading every other row in Pivot table

Hi all,

I'm trying to shade every other row in a pivot table simply based on being the odd or even row number. In other words rows 1,3,5,6,9,etc. would be a color and 2,4,6,8,10,etc. would be another color.

I've tried to write code on the background color of the field using rowno() and count() but no success.

Any suggestions would be extremely helpful.

12 Replies
Not applicable

Shading every other row in Pivot table

In a straight table it is a setting, but that doesn't work for a pivot table. However, you can set the background color on dimensions and expressions.

Dimension: click on the plus-sign in front of the dimension and double-click on the Background Color option.

Expression: click on the plus-sign in front of the dimension and click on the Background Color option. There is a Definition window on the right now.

Add the following expression to all the Background Color fields (dimensions and expressions):


=if(even(RowNo()),lightgray(),white())


If you don't like the color, you can use a lot of other standard colors (search 'color' in the help) or use RGB(230,230,230) for lighter grey for instance.

Not applicable

Shading every other row in Pivot table

Gud example is given by Mark. There is also a feature called 'ColorMix', see help. It is used to set colors for text, or background. More detail is available in manual on ColorMix.

Not applicable

Shading every other row in Pivot table

Cool ... thanks for the tip sunil18vns Smile

Not applicable

Shading every other row in Pivot table

Thanks for your help.

Where can find the manual on ColorMix?

Not applicable

Shading every other row in Pivot table

It can be found in the Help. Just search for 'colormix'. I can post the text if you like Smile

Not applicable

Shading every other row in Pivot table

Oops, double post ...

Not applicable

Shading every other row in Pivot table

In my case, it works when I have one dimension. But when I put multiple dimensions, the same formula does not work. Can anyone please check and let me know the reason.

Not applicable

Shading every other row in Pivot table

To be able to do that, you need an identifier for field product.

That way you can replace the 'even(RowNo())' part with something that identifies each product.

Have you tried the Color Mix Wizard?

Not applicable

Shading every other row in Pivot table

Hi Mark,

I searched for colormix in Help. I'm still not sure how to start/access the colormix wizard from the instructions below:

With the Colormix Wizard, opened from the File menu in the Edit Expression dialog, it is possible to create a colormix expression, i.e. an expression that calculates a dynamic color from a given measure.

Can you give me more specific instructions to access the colormix wizard?

Thanks

Ward