The if formula not work correctly.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
when I first time run the workflow, it works fine, but when I second time run it, pop out the error. my formula should be
IF [JOURNAL]= "321" or [JOURNAL]= "331" or [JOURNAL]= "341" THEN "TURE" ELSE "FALSE" ENDIF
Solved! Go to Solution.
- Labels:
- Datasets
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @Beckyli at the moment, you're likely getting that error as your [JOURNAL] field is numeric and by wrapping your checks in quotes i.e. "321", "331", you're looking for a string value. Therefore, you can either use a Select tool before your formula and make [JOURNAL] a string data type, or remove all of the quotes from your Formula tool expression to leave:
IF [JOURNAL]= 321 or [JOURNAL]= 331 or [JOURNAL]= 341 THEN "TRUE" ELSE "FALSE" ENDIF
Also, as a side note: You can clean up expressions like this by using the 'IN' function so that you don't have to type out X = or X = or X = multiple times. In your case this would be:
IF [JOURNAL] IN ("321","331","341") THEN "TRUE" ELSE "FALSE" ENDIF
Or if you keep [JOURNAL] numeric:
IF [JOURNAL] IN (321,331,341) THEN "TRUE" ELSE "FALSE" ENDIF
