What is wrong with this and why am I getting an error? (The formula is invalid: Unknown token found during parsing)
I want to calculate the Vendor ID based on Vendor Name. In fact even just a simple IF isn’t working for me.
IF (FT_VENDOR_NAME=‘VENDOR ONE’,‘VEND1’,
IF (FT_VENDOR_NAME=‘VENDOR TWO’,‘VEND2’,
IF (FT_VENDOR_NAME=‘VENDOR THREE’,‘VEND3’,
IF (FT_VENDOR_NAME=‘VENDOR FOUR’,‘VEND4’,‘’)
)
)
)
You original post and formula looks to be setup to populate the VendorID from the VendorName field and I imagine you have this in the Formula field for the VendorName. I think you just need to rearrange which field will generate the output in the other.
Essentially you want IF(FT_VENDOR_ID=“VEND1”,“VENDOR ONE”) in the VendorName field. You would then make the Flags for VendorName be Assignable, Required, Calculate and Auto-Calculate. You could also have the Selectable Flag and options, if you wanted to provide choices for the user.
If you’re looking to do the opposite and have the VendorID populate from the VendorName, you would switch things around.
I did switch it around, sorry. But it is still not working.
This is the Formula for FT_Vendor_Name:
IF (FT_VendorID=“VEND1”,“VENDOR ONE”,
IF (FT_VendorID=“VEND2”,“VENDOR TWO”,
IF (FT_VendorID=“VEND3”,“VENDOR THREE”,
IF (FT_VendorID=“VEND4”,“VENDOR FOUR”,“”))))
I am using the “Preview” and selecting VEND1.
FT_VENDOR_NAME stays blank. I click the calculator and nothing happens. I hover and I see the same scope variable error.
The Dependent Items switches automatically as shown in the screenshot.
I think I see what the problem is and it’s literally not a you thing but an IDC thing lol It’s one I get stuck on often, too.
Try this as your formula:
IF (EQ(FT_VendorID,“VEND1”),“VENDOR ONE”,
IF (EQ(FT_VendorID,“VEND2”),“VENDOR TWO”,
IF (EQ(FT_VendorID,“VEND3”),“VENDOR THREE”,
IF (EQ(FT_VendorID,“VEND4”),“VENDOR FOUR”,“”))))
NOTE: You may need to reinput the " marks as it may not interpret them accurately when copying and pasting.