Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

If Statement

jlfromm
8 - Asteroid

I have file with a end date in it. I tried to create a if statement that If the end date is a certain date then use this date in the  QTR FYE column 

 

Example 

 

jlfromm_0-1646339392816.pngjlfromm_1-1646339452466.png

 

However this saying 

jlfromm_2-1646339517983.png

 

 

6 REPLIES 6
apathetichell
18 - Pollux

your problem is the last part of your expression:

else "error" or 0 is written wrong for a few reasons:

1) Else is not a compare (elseif is).

2) "error" or 0 is litterally an expression comparing two values which cannot be compared (a string and a number)

3) This field is a date field it cannot have either a string, a number or a boolean value which your OR statement would return in it.

4) Try else null()

binuacs
20 - Arcturus

@jlfromm the last part of the else condition is not correct. you cannot use 'or' in the if else condition 

 

1. else ''error' or 0 is not correct, it should be else 'error'

2. you cannot use string or integer in the date type format field

 

you can write something like below

 

binuacs_0-1646340139570.png

 

 

jlfromm
8 - Asteroid

jlfromm_0-1646340157691.png

Still get the same error

binuacs
20 - Arcturus

@jlfromm I can see there is a space after one of the ElseIF statement (3rd else if). please remove the space 

jlfromm
8 - Asteroid

THANK YOU 

 

rrahu07
8 - Asteroid

@jlfromm I agree with @binuacs. your last endif has space.

Labels