Dario Federici
Dario Federici

Reputation: 1258

Wrong SSRS Expression

I've got this expression in an SSRS form:

=IIf(Fields!Number_Of_Txns.Value > 2, (Fields!Avg_Interpurch_Interval.Value/(IIf(Fields!St_Dev_Interpurch_Interval.Value = 0, 10000, Fields!St_Dev_Interpurch_Interval.Value))), 0.2)

What it should do is: if the Number_Of_Txns is > 2 and the standard deviation is not = 0 then divide the interpurchase interval by the standard deviation on the other hand if the standard deviation = 0 or the Number_Of_Txns <= 2 than just return 0.2

Where is the error?

Upvotes: 0

Views: 44

Answers (1)

NickyvV
NickyvV

Reputation: 1746

You should first check both conditions, so your expression should be:

=IIf(Fields!Number_Of_Txns.Value > 2 AND Fields!St_Dev_Interpurch_Interval.Value <> 0
    ,Fields!Avg_Interpurch_Interval.Value / Fields!St_Dev_Interpurch_Interval.Value
    , 0.2)

Upvotes: 1

Related Questions