We are trying to get this formula to work. We keep getting a parse error.
if(cast([Stock Forecast].[Record Id], numeric)=2) and cast([Stock Forecast].[Order Type], numeric) = 9)
then
([Stock Forecast].[Open Quantity] * -1)
else
[Stock Forecast].[Open Quantity]
Record ID and Order Type are varchar fields and open qty is numeric. Thank you in advace for any suggestions!
if( cast([Stock Forecast].[Record Id], numeric)=2) and cast([Stock Forecast].[Order Type], numeric) = 9) )
then
([Stock Forecast].[Open Quantity] * -1)
else
([Stock Forecast].[Open Quantity])
check your parenthesis
Thank you for the info. It seems to be off though. If we just do it with one cast it works but when we add the other it does not want to work. Any suggestions?
This is what works:if (cast([Stock Forecast].[Record Id], numeric) =2 )
then
([Stock Forecast].[Open Quantity] * -1)
else
([Stock Forecast].[Open Quantity])
Does not work:if (cast([Stock Forecast].[Record Id], numeric) =2 )
and
if (cast ([Stock Forecast].[Order Type], numeric) = 9)
then
([Stock Forecast].[Open Quantity] * -1)
else
([Stock Forecast].[Open Quantity])
Does not work:
if (cast([Stock Forecast].[Record Id], numeric) =2 )
and
cast ([Stock Forecast].[Order Type], numeric) = 9
then
([Stock Forecast].[Open Quantity] * -1)
else
([Stock Forecast].[Open Quantity])
Does not work:
if (cast([Stock Forecast].[Record Id], numeric) =2 )
and
(cast ([Stock Forecast].[Order Type], numeric) = 9)
then
([Stock Forecast].[Open Quantity] * -1)
else
([Stock Forecast].[Open Quantity])
Hi,
How about:
if (cast([Stock Forecast].[Record Id], numeric) =2
and
cast ([Stock Forecast].[Order Type], numeric) = 9)
then
([Stock Forecast].[Open Quantity] * -1)
else
([Stock Forecast].[Open Quantity])
MF.