Friday, February 24, 2012

conditional background color

Hello,

Is it possible to do conditional background color formatting on Matrix?

Thanks,

You can do that by setting the background color to the following expression:
=IIF(RunningValue(Fields!YourField.Value, CountDistinct, Nothing) Mod 2 = 1, "Color1", "Color2")
RunningValue returns an aggregate. In this case, it will keep counting "YourField" values:
YourField | Result of "RunningValue(Fields!YourField.Value, CountDistinct, Nothing)"
1 | 1
5 | 2
23 | 3
etc
If you would replace "CountDistinct" with for example "Sum", it would work like:
1 | 1
5 | 6
23 | 29
etc
The rest of the expression should be self explanatory.

No comments:

Post a Comment