Trying to create a new field based on the data in my other columns. My 3 existing columns are Region, Product & Store.
If the Region= 1 then I need the new column to say "Corporate"
If the Region = 2 then I need the new column to say "Affiliate"
If the Product = "***" then I need the new column to concatenate the Store + "Unknown"
If none of the 3 conditions above are met, I need the new column to simply concatenate Store and Product.
My syntax is as follows:
if [Region]=1 then "Corporate" elseif [Region]=2 then "Affiliate" elseif [Product]="***" then tostring([Store])+"Unknown" else tostring([Store])+[Product] endif
It seems like my formula is breaking down when I get to the 3rd condition. For reference, my Store column is Double so I am adding tostring() before concatenating.
Where am I going wrong?
Thanks in advance,
@CDIns - this looks good assuming Product is a string and Region is numeric. Can you provide some data?
@CDIns i don't see any issue with your formula. Can you screen shot the error here?
IF [Region] = 1 THEN
"Corporate"
ELSEIF [Region] = 2 THEN
"Affiliate"
ELSEIF [Product] = "***" THEN
toString([Store]) + " Unknown"
ELSE
toString([Store]) + " " + [Product]
ENDIF
@CDIns - See attached
Hi Bren,
Thank you for the quick reply- I'm not sure what the issue was. I deleted the formula tool and re-added it now it works fine. Thanks, anyways!
Hello,
Thank you for the quick reply- I'm not sure what the issue was. I deleted the formula tool and re-added it now it works fine. Thanks, anyways!