Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
ALTER.NEXT:

Join us on Dec 2 for a half-day virtual analytics + data science event!
US & CA customers only

SAVE YOUR SPOT
It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!
SOLVED

Iterative Macro to sort Route

Highlighted
Alteryx Certified Partner

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

...

Highlighted
Alteryx Certified Partner

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

Highlighted
Alteryx Certified Partner

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?

Highlighted
Alteryx Partner

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

Labels