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

Iterative Logic

maverick_70
7 - Meteor

Hello,

 

I have a data in which I have to run an iterative loop. Although, I am having trouble to do it in Alteryx.

Attached is the Sample data and the logic and the result I am looking for.

Column1Column2
ABCa1234
ABCb4321
a1234c4545
a1234d6565
b4321z1234
b4321f8686

 

In the picture, the result that I need is highlighted.

 

Capture.JPG

4 REPLIES 4
cmcclellan
13 - Pulsar

Is it always 3 levels, or can it be X levels and you have to loop to the bottom?

 

If it's 3 levels, you can just join the data to itself 3 times over and you will have the result.

 

If you have to loop to the bottom you will need to create an iterative macro to do it.

maverick_70
7 - Meteor

There are more than 3 levels. 

DavidP
17 - Castor
17 - Castor

Hi @maverick_70 

 

This problem has been driving me crazy all week, which makes the solution all the more satisfying!

 

I created a slightly bigger dataset with slightly easier names.

 

iterative macro 3.png


I then built an iterative macro to solve the problem. The macro limit is set to 10 levels, but this can be increased.

 

I've attached the files as a package - try this first. If you have problems with this due to different Alteryx versions, open both the macro and workflow in a text editor and change the version number in the 1st line to your version. Then save the macro in your macros path and you may have to re-insert the macro in the workflow. 

 

Let me know if you have issues with this and also your version of Alteryx and I'll try and help.

 

iterative macro.png

iterative macro 2.png

maverick_70
7 - Meteor

This is great. Works exactly as I needed. Thank you

Labels