Hello Alteryx Community,
Reaching out for help to solve this error message.
Thank you
Solved! Go to Solution.
Hi @YLYONG ,
First of all your dates should be placed within quotation marks and this is what causes the error. So your if statement should look like :
IF [ORDER DAY]="THU" THEN "22/07/2021"
ELSEIF ...
I can also see that you have selected the data type of the ORDER_DATE field to be a Date. Alteryx recognises dates when those are in the yyyy-mm-dd format so you might want to rethink of changing the values to "2021-07-22" or change the column data type to a V_String.
Hope that helps,
Angelos
Hello @YLYONG ,
The answer from @AngelosPachis is very good and fixes most of the things,
there is just one thing I want to add.
* The error itself from your formula actually comes from that you have a condition
in the ELSE-clause.
You wrote the end of the formula as:
"ELSE [Order Day] = "Wed" THEN 28/07/2021"
ENDIF
One cannot have condition in the else clause and the best way is
to add one more elseif clause first like this, then ELSE "" in the end.
In that way you can keep your condition that you had for wednesday:
ELSEIF [Order Day] = "Wed" THEN 28/07/2021"
ELSE ""
ENDIF
This is also possible without another ELSEIF clause, by just writing
ELSE 28/07/2021
ENDIF
But the problem with that is if you have any other Order Days that are misspelled, they
will also get the date 28/07/2021, as everything that is not MON,TUE,THU,FRI,SAT,SUN
will get that date.
Therefore the first solution is more safe.
After just changing the ELSE-clause in the end, this workflow would actually be able to run,
but the answer would be very wierd as @AngelosPachis mentioned.
The result would be like this, if you still would have the type as date:
Therefore after changing this I would do the suggestions that was outlined above.
1. Add citation signs and change to String Type.
2. Add citation signs and change to correct Date format and keep Date Type.
//Regards
Elias
Nice catch @Elias_Nordlinder, I totally missed that! Also well done for putting the time to write such a comprehensive post 👍
@YLYONG Can you please let us know what's the data type of the [Order Day] field? Maybe you can share part of the workflow so we can have a look, and save you time going back and forth?
Best,
Angelos
Hi @AngelosPachis,
The data type of the [Order Day] is double.
The reason I chose 'double' is becuase I need to sum the [Order Day]
I have changed to formula replacing [Order Day] with [Day] which is a string and this fixes the error.
@YLYONG Yes that would make more sense, as Alteryx won't be able to Sum "Thu" with "Sat" as you can't apply a mathematical operator between strings.
Does the workflow works as expected now that you've applies that fix?
@AngelosPachis @Elias_Nordlinder yes, this makes sense now and the workflow is working fine. Thank you for your assistance.
@AngelosPachis @Elias_Nordlinder, yes the workflow is working fine and is making sense now. Thank you for your assistance!