Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Formula error at ENDIF. Can use some help.

Tjillett
7 - Meteor

Having an issue with this formula looking for some help on what I'm doing wrong. I'm still a novice but not a beginner. Tried a few solutions. 

 

IF IsNull([Ship from Location]) then DateTimeAdd([Commited Ship Date],7,"days") ELSEIF
IF [Ship from Location]="Air" THEN DateTimeAdd([Commited Ship Date],7,"days") ELSEIF
IF [Ship from Location]="Ocean" THEN DateTimeAdd([Commited Ship Date],45,"days") ENDIF

 

Formula (26) Parse Error at char(254): Malformed If Statement (Expression #1)

 

As always this group is top notch for helping out users. 

 

Thank You in Advance 

Ted Jillett

7 REPLIES 7
Thableaus
17 - Castor
17 - Castor

Hi @Tjillett 

 

IF IsNull([Ship from Location]) then DateTimeAdd([Commited Ship Date],7,"days") ELSEIF
[Ship from Location]="Air" THEN DateTimeAdd([Commited Ship Date],7,"days") ELSE
DateTimeAdd([Commited Ship Date],45,"days") ENDIF

 

No IF's after ELSEIF's. Also, you need to add an ELSE Clause.

 

See if this works out well.


Cheers,

Tjillett
7 - Meteor

Thank you for the very quick solution. 

Have a great weekend

Thableaus
17 - Castor
17 - Castor

You too @Tjillett 

 

Having any questions let us know.


Cheers,

DBourke19841
8 - Asteroid

Having a similar issue with an if formula. I'm sure it's something silly I'm missing

DBourke1984_0-1599829930180.png

 

Any guidance would be appreciated.

 

Thanks,


Donal

 

Tjillett
7 - Meteor

If you look at my original question I had everything as "ELSEIF" the comment made to me was that it was only the first one that was needed and the rest were just "ELSE" seems like you have the same issue. Give it a try and let me know if works. 

Ted

Alt_eryx22
6 - Meteoroid

Ok so I've read this whole chain and I'm still having the same issue. Everything looks fine until I add "endif". If I do, it grays out parts of my code. Any idea how to fix?

Alt_eryx22_0-1639021965265.png

Alt_eryx22_1-1639021978987.png

 

IF [Effective year]=[User.Current Year] THEN [Cash received and 12-month projection for T-Initial polices]+[2020 Cash Received]
ELSEIF [Effective year]=[User.Prior Year] THEN [Cash received and 12-month projection for T-Initial polices]+[2019 Cash Received]
ELSE 0
ENDIF

Mchappell67
9 - Comet

Hi, @Alt_eryx22 -

 

Could it be a mismatched data type issue?  Are you sure that [User.Prior Year] exists?  Can you post the workflow?

 

Mark

Labels