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 Macro to sort Route

outwork
7 - Meteor

I have a dataset with start and end locations in 2 seperate columns. The data is shuffled. The end location is the new start location in another row. How can I sort this to get an output like this

 

Before

Barcelona -> Paris

Madrid ->New York

Paris -> Madrid

 

After:

Barcelona -> Paris

Paris -> Madrid

Madrid ->New York

...

7 REPLIES 7
LordNeilLord
15 - Aurora

Hey @outwork

 

How about this?

 

AirportLeg.PNG

 

I added some functionality to find the first journey (based on the first unique start location) but you can ditch that if you don't need it.

 

I've also set the number of iterations to 10 which you can change depending on how many legs you might need.

 

@LordNeilLord

Part time Tableau, Part Time Alteryx. Full Time Awesome


Data Lover

outwork
7 - Meteor

exactly what I was looking for.  Thanks a lot LordNeilLord! Higly appreciated. Can you recommend further sources to learn macros and worklows beside simply building them?

annaprosvetova
7 - Meteor

Thank you for posting this solution, Neil! Was trying to solve a similar problem, and your workflow is just perfect!

handa997
5 - Atom

.

 

 

WCH
7 - Meteor

Hi Neil,

 

Are we still able to find that "Engine.IterationNumber" function in the formula tool? Thanks.

Luke_C
17 - Castor

@WCH You can, but only if the workflow is an iterative macro:

Luke_C_0-1617051864916.png

 

WCH
7 - Meteor

just figured it out 1 sec ago. Thanks  Luc!!

Labels