SSRS Expression for IF, THEN ELSE
Asked Answered
K

1

23

I am creating a field from tables with our shoretel phone system and i am intergrating reports via SSRS and i need some assisstance with an expression.

=if(Fields!ExitReason.Value 7,
then if (Fields!ExitReason.Value 1,
else if (Fields!ExitReason.Value 0,)))

Definition results should be:

=if(Fields!ExitReason.Value) = 7 then 1 else 0

I am try to get the field to give me 7, 1 else 0. Any assistance would be great.

Thanks, Arron

Kwh answered 4/12, 2013 at 19:22 Comment(1)
Take a look at #3552466Wimbush
P
47

You should be able to use

IIF(Fields!ExitReason.Value = 7, 1, 0)

http://msdn.microsoft.com/en-us/library/ms157328.aspx

Phelgen answered 4/12, 2013 at 19:37 Comment(2)
I have a field called ta_amount. if the value inside this filed is >100 then it's should be divided by 100 otherwise display "no pound". but my expression gives me a error. =IIf((Fields!ta_amount.Value > 100), ([(Fields!ta_amount.Value)/100]), "No Pound")Manicotti
I know this is old but the answer to @aselanuwan comment is found in this other SO question #37283787. In summary, IIF doesn't short-circuit, meaning it always evaluates both sides, regardless of the result.Archipenko

© 2022 - 2024 — McMap. All rights reserved.