Alteryx Designer Desktop Discussions

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

Logic help

SahilArora3139
8 - Asteroid

Hi team

 

i want to create a logic using formula tool with following details:

 

destination      Travel                     Class

Domestic.        All flights/train.     Base class

international   <.  8 hours              Base class
                        >= 10 hours.           1st class

 

please confirm if i am using correct logic to get the desired outcome

 

if travel < 8 then ‘base class’ else ‘1st class’

endif

but i am getting error in this.

please help me to get the logic sorted.

I want to highlight the exceptions where these parameters are not met

 

For example: like if international destination where time is taken less than 8 hours but is using 1st class then this is the exception as class should be base in this case.

 

 

5 REPLIES 5
Qiu
20 - Arcturus
20 - Arcturus

@SahilArora3139 
Interesting. Our company is also using the criteria of 8 hours for international flight.

First, I think we should see if it is domestic or international travel then for international flight, we can judget by travel time.

There is an argument for flight time between 8 and 10 hours, which class it should be?
I assume belowl

1128-SahilArora3139.png

SahilArora3139
8 - Asteroid

Thank you for the help.

but what if we have three columns mentioned in our sheet and we just need to flag the exceptions which does not follow the criteria.

 

like if the destination and  time matches but class doesnt match then its an exception 

 

 

Hammad_Rashid
11 - Bolide

if [destination] == 'Domestic' then
'Base class'
else
if [Travel] < 8 then
'Base class'
elseif [Travel] >= 8 and [Travel] < 10 then
'1st class'
else
'Exception' // Add a column to flag exceptions
endif
endif

 

In this logic:

  • If the destination is "Domestic," the class is set to "Base class."
  • For international flights, if the travel time is less than 8 hours, the class is set to "Base class."
  • If the travel time is between 8 and 10 hours for international flights, the class is set to "1st class."
  • If none of the above conditions are met, an "Exception" flag is set, indicating that the parameters do not follow the criteria.
AndrewDMerrill
13 - Pulsar

Another alternative, adds a new column [Exception] which tracks when the class does not meet criteria set forth above:

if [destination]="Domestic" then [Class] != "Base class"

elseif [Time]<8 then [Class] != "Base class"

else [Class] != "1st class"
endif

Formula Tool 1.png

Formula Tool 2.png

SahilArora3139
8 - Asteroid

Thank you everyone. I will try this one. And will try if thee is any issues :)

Labels