SSRS table report with every other row shaded UNLESS row has an empty cell

Viewed 25

I have a report that I've got shading every other row light blue. I'd like to add to the expression so that if the Price_Updated_On field is blank it will shade that row in Gold. I've been unable to work it out and just keep ending up with expected ) errors, no shading at all or another error I can't remember right now.

This produces no shading at all:

=SWITCH(IIF(ROWNUMBER(NOTHING) MOD 2, "LIGHTBLUE", "WHITE"), IsNothing(Fields!Price_Updated_On.Value), "Gold")

This complains [BC30198] ")" expected:

=IIF((ROWNUMBER(NOTHING) MOD 2, "LIGHTBLUE", "WHITE"), IIF(Fields!Price_Updated_On.Value="", "Gold"))

I can't seem to come up with a version that caused the other error message but, I feel like I'm getting nowhere. Any help would be greatly appreciated!

1 Answers

It sounds like the expression will need to check for the blank condition first and then use the alternate row color if not blank.

=IIF(Fields!Price_Updated_On.Value="", 
    "Gold", 
    IIF(ROWNUMBER(NOTHING) MOD 2, 
        "LIGHTBLUE", 
        "WHITE"
        )
    )
Related