Alternate rows background color in a group

veljasije picture veljasije · Feb 13, 2013 · Viewed 23.2k times · Source

I have following situation:

Report with nested groups, whether group column has value 1 or 2. Next child group has 2 groups for each parent group, so for parent group 1 there is two child groups (1-1 and 1-3), and also for parent group 2 I have two child groups (2-2 and 2-4).

My question is, how to set color to WhiteSmoke for rows from 1-1, and color White for rows from 1-3, and again WhiteSmoke for 2-2 and White for 2-4.

If there is order like 1, 2, 3, ..., then will be easy with using Mod operator, but my order is 1, 3, 2, 4 and i cannot find algorithm for alternating color

EDITED

enter image description here

Answer

user2709483 picture user2709483 · Aug 23, 2013

I found the answer.

=IIF(RunningValue("NameofGrouptoAlternateColor", CountDistinct, "NameofParentGroup") Mod 2, "White", "Wheat")

This worked for me and I think it's what the original poster was trying to accomplish.