AnsweredAssumed Answered

How to do a conditional calculations

Question asked by oscarmcl on Sep 3, 2020
Latest reply on Sep 16, 2020 by martin.adams

Hello,

 

I'm having trouble programming the intelligent report with conditional calculations.

 

"AV" is calculated from the average of the results obtained, applying a different formula depending on the case.

The cases are as follows:

 

98.5% ≤ Mean ≤ 101.5% --> AV = k*s

Mean < 98.5% -->    AV = 98.5 - Mean + K*s

Mean > 101.5 -->  AV = Mean – 101.5 +K*s

 

Where k is a constant (2.4) and s is standard deviation.


I have thought about this option (as an excel formula):

=IIF(Xlan<98.5, 98.5-Xlan+2.4*Slan, IIF(Xlan>101.5, Xlan-101.5+2.4*Slan, 2.4*Slan))

 

Where:

  • Xlan is the mean saved as variable
  • Slan is the standard deviation saved as variable

 

but it causes me a error in the program and changes it to this:

 

=IIF(Xlan<98.Code(DVL("5")),98.Code(DVL("5"))Xlan+2.4*slan,IIF(Xlan>101.Code(DVL("5")),Xlan-101.Code(DVL("5"))+2.4*slan,2.4*slan))

 

 

Why doesn't the formula work?

How could I set up the formula in a simple way?

 

¡A lot of thanks!

Òscar

Outcomes