Start Free Trial

Alteryx Designer Desktop Discussions

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

Help in modifying formula

Navya08
8 - Asteroid

 

Scenario:

 

 

I have an expense report dataset with flight details. I want to flag exceptions based on our company travel policy, which states:

 

  1. Domestic flights must be Economy class only.
  2. For International flights:
    • If flight duration is < 7 hours → must be Economy class.
    • If flight duration is ≥ 7 hours → Business class is allowed.I HAVE USED THE BELOW FORMULA BUT i need to add this criteria which says if  business eligibility is there but economy is booked then it should not be an exception. 
      how should i add this parameter?
2 REPLIES 2
Qiu
21 - Polaris
21 - Polaris

@Navya08 
I would recommend to use the integer to flag the class so we can easily compare using larger small.
And also a mapping file to hand the case of Premium Economy  and also mark the classes with Integer.

0609-Navya08.png

Dhrish
8 - Asteroid

@Navya08 You can use this formula:

Switch([Flagged],"exception",[class?]=[Cabin class] or ([class?]="business class" and [Cabin class]="Economy/Coach class"),"no exception")

I agree with @Qiu solution as well, as this can help you in specifying the weightage of each class and compare easily.

Labels
Top Solution Authors