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

Replace with rules of exception

Benji27
8 - Asteroid

Hello Alteryx communauty!

 

I need your help about a complex used case

 

Here details:

1st file is Data.xlsx that contains data with book, trading code, hierarchy, etc

2st file is Exceptions2.xlsx that contains rules of exception

3rd file is OutputfileData.xlsx that contains result  (yellow value of TPMethodo_Name column are expected value)

 

The aim is to update the column TPMethodo_Name  (column K) from the Data.xlsx file by the value of column  Methodology Name (column I) from Exception2.xlsx file 

 

How to read rules of Exception2.xlsx file 

Line 2 : 

If TPAgree_Code = "EQ_AMT" and TRADINGSITE = "Paris"  and STRATEGY contains the word "Options" 

Then  TPMethodo_Name <-- RS_AMM_MMO

 

Line 3: 

If TPAgree_Code = "EQ_AMT" and TRADINGSITE = "Paris"  and STRATEGY contains the word "Stock" 

Then  TPMethodo_Name <-- RS_AMM_MMO

 

Line 4 : 

If TRADINGSITE = "Shangai"  and GLOBALBUSINESSLINE contains the word "FXLM CD" 

Then  TPMethodo_Name <-- RS_SHANGAI

 

Line 5 : 

If TPAgree_Code = "EQ_AMT" and TRADINGSITE = "Hong Kong"  and STRATEGY contains the word "Futures" and SUBSTRATEGY contains the word "Japan" 

Then  TPMethodo_Name <-- RS_AMM_MMF

 

Line 6 : 

If TPAgree_Code = "CIT_OIL" 

Then  TPMethodo_Name <-- RS_CITOIL

 

Like as you see, when a value is empty, we don't take in account 

 

Here you can find the 2 files

 

Hope you can help me !

 

Many Thanks

 

13 REPLIES 13
atcodedog05
22 - Nova
22 - Nova

Hi @Benji27 

 

This took me some time here is a workflow. What this does it dynamically create the formula based on your exception excel and apply the formula to the data using the dynamic replace tool. The formula is dynamically created and applied always.

 

atcodedog05_0-1646219952948.png

 

Output: Not a lot of matches you might want to check conditions.

atcodedog05_1-1646220020982.png

 

Hope this helps : )

Benji27
8 - Asteroid

Thanks @binuacs but no : you need to use value only from Exceptions2 file not directly on formula

Benji27
8 - Asteroid

Thank you very much!

 

You're a genius @atcodedog05 !!!

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @Benji27 

Cheers and have a nice day!

Labels