Two Expressions - IF/THEN logic

  • I have this expression that works fine:

    =IIF(Fields!Interest_Only_Flag.Value ="Y",IIF(Fields!Loan_Type.Value = "Residential HFI 5YH", "28",

    IIF(Fields!Loan_Type.Value = "Residential HFI 3YH", "27", IIF(Fields!Loan_Type.Value = "Residential HFI 7YH", "29",

    IIF(Fields!Loan_Type.Value = "Residential HFI 1ML", "26", IIF(Fields!Loan_Type.Value = "Residential HFI 6ML", "25",""))))),"")

    I need to add this part: (the 'N' part):

    =IIF(Fields!Interest_Only_Flag.Value ="N",IIF(Fields!Loan_Type.Value = "Residential HFI 5YH", "18",

    IIF(Fields!Loan_Type.Value = "Residential HFI 3YH", "17", IIF(Fields!Loan_Type.Value = "Residential HFI 7YH", "19",

    IIF(Fields!Loan_Type.Value = "Residential HFI 1ML", "16", IIF(Fields!Loan_Type.Value = "Residential HFI 6ML", "16",""))))),"")

    I need the above two expressions to work together...guessing I can't use both at same time?

  • I would try using the switch function for the "Y" and "N", and nest the IIFs inside the switch. I'm not positive it would work, but it's worth a shot.

    Edited: check out the 3rd post on this thread. It has an example you may be able to leverage.

    http://www.sqlservercentral.com/Forums/Topic558383-150-1.aspx

    Hope that helps,

    -Marianne

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply