We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Macro to match values sequentially

Nandakishore
8 - Asteroid

Hi ,

 

I have this requirement of matching values between two tables : 

 

Table 1    
CcodeDco  
A11111  
B11121  
C11122  
    
Table2    
CcodeSuffixClassFlow 
A1C1F1
B11C2F2
C111C3F3

 

Based on the CCode and Suffix available in table 2 need to be compared with values available in CCode and Dco of table 1 . If they are matching then bring Class and Flow to table 1 .

 

Can anyone propose a macro solution for this , as matching suffix is difficult for me . 

 

Thanks

4 REPLIES 4
caltang
17 - Castor
17 - Castor

Not sure what you mean by matching suffix. Are you saying that for Table 2, with value of 1, 11, and 111 - it matches to Table 1 11111, 11121, and 11122?

 

So, if A, then the next match is A, but 1 matches to 11111 to 1? Can you provide more explanation please?

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
Nandakishore
8 - Asteroid

Hi @caltang ,

 

In table 2  CCode A has suffix as 1 , so in table 1 m for row with CCode A has to look for suffix 1 in DCo column . If it matches move class and flow . Then move to next  .

 

THanks

 

mceleavey
17 - Castor
17 - Castor

Hi @Nandakishore ,

 

I share @caltang 's confusion here and you have not provided an example of what you want to see which could possibly makes this easier, however, if you are simply trying to join on two fields, first where Ccode matches, and then where suffix is contained in Dco, then you simply need to join on Ccode then apply formulae to the required fields, in this case Class and Flow:

 

Screenshot 2023-09-06 144810.jpg

Screenshot 2023-09-06 144850.jpg

 

This then only returns the Class and Flow values for those where the Ccode matches, and the suffix is contained within Dco.

 

I hope this helps,

 

M.



Bulien

rzdodson
12 - Quasar

Another potential solution with an iterative macro approach. Used the length of the suffix to support the filtering logic (Length = {Engine.IterationNumber=1) to test whether the ending of the DCO field matches the Suffix from Table 2.

 

Edit: changed the filter logic contained in the iterative macro to filter out for records where the Code field matches the Source_Code field. Reporting workflow and picture.

 

Value Comparison workflow.png

 

Iterative Macro filter.png

Labels
Top Solution Authors