Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Bypass Failure Condition by exception in Alteryx Designer

Antony89anto
7 - Meteor

Hi Friends

 

I am looking for solution for the below scenario. This is just an example and actual logic includes 100's condition and various logic. 

 

I have a Employee Table, and Appeal table with me. 

 

Employee

Emp_IDExperienceAgeSalaryRating
381687326165202
277876437132682
2207871047146532
593529126159943
815231243124532
1135322449162281
283733632126343
831438437122563

 

 

Each employee go thru some conditions in the workflow. I will be using couple of Filter conditions to qualify. If any employee does not meet (False) condition, we need to append a Error code for rejection (Using formula tool). In the Screenshot below, Cd='E111' is a Rejection Error code for Experience Criteria, Cd='A111' is a Rejection Error code for Age Criteria and Cd='R111' is a Rejection Error code for Age Criteria.  

 

 

 

ExceptionHandling.png

 

 

Interestingly, few employees have been given an exception from these errors. If any employee who failed in the Filter condition , has an Entry (An error Code from which he is exempted) Appeal Information, he/she can be considered as eligible and should go thru the second criteria.  I.e: Employee X failed in the Experience criteria, but has an exception Appeal in Appeal table, so he will be considered as success and go to the next condition which is Age <= 40. In the next condition if he/she fails, they should be checked against Appeal Table for exception. If any exception is given for them, they will go to next condition or they will be considered as ineligible. 

 

Emp_IDCode
812153E111
1035228E111
1038904E111
1140425E111
1088434E111
494987E111
1030577E111
494987A111
812153A111
343023A111
956730R111
1028869

R111

 

 

Please suggest me which is the best approach to handle this. 

 

 

Thanks,

Antony Raj 

4 REPLIES 4
danilang
19 - Altair
19 - Altair

Hi @Antony89anto 

 

Here's how I'd handle this one

 

w.png

This solution is based around the Crews Dynamic Formula macro.  This macro applies a series of formulas in series to a set of data.  The results of each of these formulas appears as a new column of data.  The Formula text input contains these looking like this

 

f.png

 

Once the macro runs, the results are like this, with one new column for each formula with "True" if the row passed this formula and false otherwise.

 

d.png

To handle the exceptions, we transpose the condition columns so the we can join the false ones to the Exceptions table.  The ones that match get changed to "True" and everything passes through the union before being Crosstabbed back into the original format, resulting in

r.png 

 

Note that in order to get a record to go through the exception process I had to change the first ID in the exception table to 381687.  Without this change, the exception and data tables had no IDs in common.

 

Dan

Antony89anto
7 - Meteor

That's fantastic. Really cool information. 

Could you please tell me how will you handle this, if these conditions are nested? 

I.e: 

 

If age <=5 then 

if salary <=15000 then 'Ok'

else 'Not Ok' endif

elseif age<=10

if salary <=65000 then 'Ok'

else 'Not Ok' endif 

Endif

 

 

 

 

I got this question out of Curiosity! Is there anyway We can do in the same way I implemented? A single table/file should be referenced by all failure data and become true and go for another check after appeal/exemption present. 

 

Thanks

Anthony Raj 

danilang
19 - Altair
19 - Altair

hi @Antony89anto 

 

Any formula written as a series of Nested IF-THEN statements can be rewritten using IIF syntax like this

 

IIF(age <=5, IIF([salary] <=15000, "True","False"), IIF([age]<=10, IIf([salary] <=65000,"True","False"),"True")).

Add this as a new formula in the Formulas table and the results will be calculated

 

Dan

 

Antony89anto
7 - Meteor

Thank you for your timely Help.

 

Thanks

Anthony Raj 

Labels