Change Price/Quantity

Hi everyone,

My client would like to know if the change price or quantity is less or greater than the previous value indicated in the order.

The issue is that “Change_from” and “Change_to” in the Activities table is an “int” value and not a number.

What formula can I use knowing that > and < can not work?

Thank you

Laura

Hi Laura,

I think you mean that the Changed_From and Changed_To values are string values? An ‘int’ aka an ‘integer’ value is a number and could be evaluated with the > or < operators, so I assume the problem you’re having is trying to evaluate a string value with >/<. You can use the STR_TO_INT() formula to convert a string value to an integer, then use the >/< operators.

-Tyler

1 Like

Hi Tyler,

I tried with the following formula, but it return '"-" for all result:

CASE WHEN STR_TO_INT("_CEL_P2P_ACTIVITIES".“CHANGED_TO”) > STR_TO_INT("_CEL_P2P_ACTIVITIES".“CHANGED_FROM”) THEN ‘INF.’
WHEN STR_TO_INT("_CEL_P2P_ACTIVITIES".“CHANGED_TO”) < STR_TO_INT("_CEL_P2P_ACTIVITIES".“CHANGED_FROM”) THEN ‘SUP.’
ELSE ‘ERRORE’ END