Malformed IF Statement Error
- 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
Hi Community,
Getting this Malformed IF Statement Error can someone please explain how to fix this.
IF [PGI Date] = 'Check Date' THEN "Backlog" ELSEIF
IIF(isEmpty([PGI Date]), "Shipped", "Backlog")
ENDIF
TIA
Karl.
Solved! Go to Solution.
- Labels:
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You can shorten the logic here -- try this
IF isEmpty([PGI Date]) THEN "Shipped" ELSE "Backlog"
ENDIF
This is stating that any empty field in PGI Date will be categorized as Shipped otherwise its categorized as Backlog
If this helped to solve your issue, please make sure to mark it as a solution to help out other members on the community!
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
IF [PGI Date] = 'Check Date' THEN "Backlog"
ELSEIF isEmpty([PGI Date]) Then "Shipped"
ELSE "Backlog"
ENDIF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Does the following work as expected? As it stands, you always need an ELSE statement to escape your IF as the final possible outcome - as you were trying to use the immediate if after an elseif you weren't leaving space to supply this:
IF [PGI Date] = 'Check Date' THEN "Backlog" ELSEIF
isEmpty([PGI Date])) THEN "Shipped"
ELSE "Backlog"
ENDIF
The following may also work if I'm reading this right and slightly simplifies things:
IF [PGI Date] = 'Check Date' or !isempty([PGI Date]) THEN "Backlog"
ELSE "Shipped"
ENDIF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks All for your help - I used DataNath's solution.
Really appreciate the help and advice.
Cheers,
Karl.
