Alteryx Designer Desktop Discussions

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

Conditional Rule

scsmith107
5 - Atom

Hi!

 

I just started school about 2 weeks ago and we are learning Alteryx. I need to create a field with these rules: 

 

  - shipments arriving within 6 days of the expected date are flagged "On Time"
    - shipments arriving within 20 days of the expected date are flagged "Late"
    - shipments arriving over 20 days after the expected date are flagged "Significant Delay"

 

I was able to use the Formula tool to calculate the number of days but I can't get the rules to work, can someone help me please? 

 

Thank you! 

5 REPLIES 5
gawa
16 - Nebula
16 - Nebula

hi @scsmith107 

Conditional IF statements would help like this. 

IF [Days]>20 THEN "Significant Delay"
ELSEIF [Days]>6 THEN "Late"
ELSE "On Time"
ENDIF

 image.png

flying008
14 - Magnetar

Hi, @scsmith107 

 

FYI.

If [date] > 20 
Then 'Significant Delay'
Elseif [date] > 6 
Then 'Late' 
Else 'On Time'
Endif
scsmith107
5 - Atom

I entered the formula but changed days to number of days but I get an error message saying invalid operator >.

 

 

 

gawa
16 - Nebula
16 - Nebula

@scsmith107 Please be sure of field type of"number of days" are Integer(INT16,INT32,INT64 etc). Default field type of Formula is String, so if it is String field, it does not work.

scsmith107
5 - Atom

Thank you so much! 

Labels