expression error

0
If the data is located between the two dates entered using expression, you can see it. Otherwise, we try to display it as blank or 0. However, an error occurred. Thank you for your kind response.   if $currentObject/Plan_StartDate >= $SearchHelper/StartDate and $currentObject/Planned_EndDate <= $SearchHelper/EndDate then $currentObject/Performance_Plan_ProductionQuantity else 0 and try '0', and empty The error still appears   error list '0' = Incompatible expression types: Decimal, String 0 and empty = The expression is type Decimal but should be of type String
asked
1 answers
1

Hi bosum,

 

the two output options of an expression must be of the same type.

You could try casting the date into a string:

if $currentObject/Plan_StartDate >= $SearchHelper/StartDate 
   and $currentObject/Planned_EndDate <= $SearchHelper/EndDate
then toString($currentObject/Performance_Plan_ProductionQuantity) 
else '0'

Also empty instead of '0' should work then.

 

Does that help?

 

Best,

Holger

 

answered