none
SSRS 2008 conditional format with multiple conditions

    Question

  • Hi,

    I have a requirement to conditionally format cell (not row) backgroup colors using SSRS expressions (not custom code) based on the following:

    IF arrival_date IS NULL and we are 8 weeks from sys_install_date highlight the arrival_date NULL cell YELLOW and if arrival_date IS NULL and we are 6 weeks from sys_install_date highlight the arrival_date NULL cell RED.

    Thank you for your assistance.


    Francis, MCTS: BI 2008, MCITP: BI 2008 Stay Thirsty My Friends

    Tuesday, February 04, 2014 8:18 PM

Answers

  • Hi MostInterestingMan,

    You can use the following expression for the Background color of target cells:

    =Switch(IsNothing(Fields!arrival_date.Value) AND DateDiff(“w”, Fields!sys_install_date.Value, Today())=8, “Yellow”, IsNothing(Fields!arrival_date.Value) AND DateDiff(“w”, Fields!sys_install_date.Value, Today())=6, “Red”)

    If you have any questions, please feel free to let me know.

    Regards,
    Mike Yin

    If you have any feedback on our support, please click here


    Mike Yin
    TechNet Community Support

    Wednesday, February 05, 2014 2:26 PM
    Moderator

All replies

  • Hi MostInterestingMan,

    You can use the following expression for the Background color of target cells:

    =Switch(IsNothing(Fields!arrival_date.Value) AND DateDiff(“w”, Fields!sys_install_date.Value, Today())=8, “Yellow”, IsNothing(Fields!arrival_date.Value) AND DateDiff(“w”, Fields!sys_install_date.Value, Today())=6, “Red”)

    If you have any questions, please feel free to let me know.

    Regards,
    Mike Yin

    If you have any feedback on our support, please click here


    Mike Yin
    TechNet Community Support

    Wednesday, February 05, 2014 2:26 PM
    Moderator
  • This would work

    The "White" at the end just specifically says if none of these conditions exist, leave it White

    =IIf(IsNothing(Fields!arrival_date.Value) AND DateDiff(“w”, Fields!sys_install_date.Value, Today())=8, “Yellow”, IIf(IsNothing(Fields!arrival_date.Value) AND DateDiff(“w”, Fields!sys_install_date.Value, Today())=6, “Red”, "White"))

    We have some of these nested iif()'s so blinkin' deep, you need a road map to follow them ;-)


    Thursday, February 06, 2014 4:24 PM
  • Hi MostInterestingMan,

    You can use the following expression for the Background color of target cells:

    =Switch(IsNothing(Fields!arrival_date.Value) AND DateDiff(“w”, Fields!sys_install_date.Value, Today())=8, “Yellow”, IsNothing(Fields!arrival_date.Value) AND DateDiff(“w”, Fields!sys_install_date.Value, Today())=6, “Red”)

    If you have any questions, please feel free to let me know.

    Regards,
    Mike Yin

    If you have any feedback on our support, please click here


    Mike Yin
    TechNet Community Support

    Works like a charm. Thanks Mike!

    Francis, MCTS: BI 2008, MCITP: BI 2008 Stay Thirsty My Friends

    Sunday, February 09, 2014 11:43 PM
  • This would work

    The "White" at the end just specifically says if none of these conditions exist, leave it White

    =IIf(IsNothing(Fields!arrival_date.Value) AND DateDiff(“w”, Fields!sys_install_date.Value, Today())=8, “Yellow”, IIf(IsNothing(Fields!arrival_date.Value) AND DateDiff(“w”, Fields!sys_install_date.Value, Today())=6, “Red”, "White"))

    We have some of these nested iif()'s so blinkin' deep, you need a road map to follow them ;-)


    This is working now. Thank you!

    Francis, MCTS: BI 2008, MCITP: BI 2008 Stay Thirsty My Friends

    Sunday, February 09, 2014 11:43 PM