Hi guys,
I'm trying apply a formula with some data but its giving me the following error;
Error: Formula (2): The formula "Fx Trade.Product Type" resulted in a string but the field is numeric. Use ToNumber(...) if this is correct. (Expression #1)
I have the following dataset below;
Fx Trade.Product Type | Fx Trade.Product Sub Type |
FXD | |
FXD | |
XSW | |
DKK | |
XSW |
My formula below is;
if IsNull([Fx Trade.Product Type]) and [Fx Trade.Product Sub Type] = "XSW" or "FXD" then "FX"
else [Fx Trade.Product Type]
endif
The table should ultimately look like this;
Fx Trade.Product Type | Fx Trade.Product Sub Type |
FX | FXD |
FX | FXD |
FX | XSW |
DKK | |
FX | XSW |
Solved! Go to Solution.
Use a Select tool before your Formula tool to change your data type to a Strung data type - currently you are trying to put a string value in a column that’s a Double (or numeric)
@ZahinOsman one way of doing this
Hi, @ZahinOsman
Please change output type to [String] and size like 100,
IIF(IsEmpty(Trim([Fx Trade.Product Type])) && [Fx Trade.Product Sub Type] in ('XSW', 'FXD'), 'FX', [Fx Trade.Product Type])