Announcement | We'll be doing maintenance between 2-3 hours, which may impact your experience. Thanks for your patience as we work on improving the community!

Alteryx Designer Desktop Discussions

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

Iterative Macro

Shank
8 - Asteroid

Hi, 

 

I have a situation where I need to create an iterative or batch macro, and I was wondering if someone could assist me with this.

 

The scenario is that I have a list of batches, and I need to find the dependent batches for this list of batches (Input 1). For instance, A is the final batch, BB is the ingoing batch for A, CC is the ingoing batch for BB, and DD is the ingoing batch for CC. I need to get the complete link for Batch A, and the input and expected output are as follows:

 

For me, the in-scope "Type" for the dependent batches are ASM, INS, FLL. (Ref Input 2)

 

I would appreciate it if you could help me with an iterative or batch macro for this scenario. I tried couple of methods, but it did not work well.

 

Input 1 
  
ProducedMatProducedBatch
1A
2B
3C
4D
5E

 

Input 2    
     
IngoingMatIngoingBatchTypeProducedMatProducedBatch
11BBASM1A
1236FSPFGD1A
2697DPSFGD1A
22CCASM11BB
2212RPSNGD11BB
2213OPSMGD11BB
33DDASM22CC
3313HPSURS22CC
4414IPDKGD22CC
44EEINS33DD
4415PPSBRS33DD
4416LPSMRS33DD
55FFFLL44EE
5515ZPSCSP44EE
5516XPSOSP44EE
2456AAAASM2A
2487BBBINS2456AAA
2879CCCFLL2487BBB

 

Expected Output   
     
ProducedMatProducedBatchIngoingMatIngoingBatchType
1A11BBASM
1A22CCASM
1A33DDASM
1A44EEINS
1A55FFFLL
2B2456AAAASM
2B2487BBBINS
2B2879CCCFLL
3 REPLIES 3
gawa
15 - Aurora
15 - Aurora

hi @Shank 

I understand that you want to trace the layer from bottom to top(or top to bottom). In this case, Iterative Macro is the best to pick.

Here is the WF by using Iterative Macro.

To be honest, Iterative Macro is one of the difficult method, and it will take sometime to get used to it.

image.png

Shank
8 - Asteroid

@gawa Thank you so much for your Help.

 

Your assistance was invaluable in helping me achieve my goal, and I truly appreciate the time and effort you put in.

 

The solution you provided worked perfectly fine for me. I am particularly interested in learning more about the iteration macro and would love to get in touch with you to discuss it further. Let me know if it is ok for you :)

gawa
15 - Aurora
15 - Aurora

@Shank  Glad to hear that!

If you need further discussion, please create another post here in Discussions so that anybody having the same question can refer to the solution in future by making it public. 

 

At last, I introduce the Weekly Challenge which is to find hierarchy of organization by using Iterative Macro. If you are wondering what you should study first, try this first. Referring to solutions by others will be much help for your further learning. 

https://community.alteryx.com/t5/Weekly-Challenges/Challenge-12-Creating-an-HR-Hierarchy/td-p/36740

 

Good luck!

Labels