Iif Statement With Multiple Conditions

IIf And statement with multiple conditions

Most likely you need an OR operator between the two conditions as either one should return the 1 option, otherwise return 0.

IIf(([Session_ID]<154 And [Level_Avg]>[Current_Lvl]) Or ([Session_ID]>=154 And [Exam_Avg]>=2), 1, 0)

Nested iif with multiple conditions SSRS

You pretty much solved this one yourself! To write this in T-SQL you right click the Chart Name and change its value to the following expression:

IIF(Fields!chart.Value="110300" AND Fields!division.Value="100","Intercompany AP - USA",IIF(Fields!chart.Value="110300" AND Fields!division.Value="200","Intercompany AP - RUS","Default Chart Name")

See here for explanation on how the IIF function works

From the link you can see that it takes the following format, where commas are used instead of "Then" or "Else":

IIF ( boolean_expression, true_value, false_value )

So to breakdown the expression:

IIF(Fields!chart.Value="110300" AND Fields!division.Value="100",
"Intercompany AP - USA",
IIF(Fields!chart.Value="110300" AND Fields!division.Value="200",
"Intercompany AP - RUS",
"Default Chart Name"
)
)


Related Topics



Leave a reply



Submit