Alteryx Designer Desktop Discussions

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

Connect the travel path in succession

myousuff81
7 - Meteor

I have a situation where in I need to arrange the data in order, for example a customer boards the bus from Station A to Station B called route 1, then he goes from station B to Station C and so on, however the data we have is not in sequence. 

We need to find routes that are in succession. To identify the succession the customer recognized that the station he departs to in the previous route was the arriving station in his current route.

 

Example:-

(1) Customer starts from his home and depart from bus station A (route 1)

(2) Arrives in station A and Departs to station B (route 2)

(3) Arrives in station B and Departs to Station C (route 3)

 

 

Station.png

 

 

12 REPLIES 12
CharlieS
17 - Castor
17 - Castor

Attached is a example of how an iterative macro could be used to solve for find the next route segment each time. It could use a lot more work on things like how to handle if there isn't a "Home" to start from, or if a segment is missing. Hopefully this gets you started.

 

myousuff81
7 - Meteor

Thanks Charlie. This is a perfect solution.

benbenjoy
8 - Asteroid

I tried to use it in my workflow which has got 2000 records. However it is not working and keep outputing the loop result. Do you know why is that? Do I need to do anything for the interface?

 

Thanks

alexey_nikityuk
8 - Asteroid

@CharlieS, I have similar problem as @benbenjoy, when having 1000 lines the logic is not working. I adjusted Append formulas to allow it to go beyond 16 lines, but the macro just keeps spinning without any output....

 

Can you please advise on this? 

CharlieS
17 - Castor
17 - Castor

@benbenjoy - The example solution from above has the iterations limited to 100. Try increasing that in the Interface Designer (Ctrl+Alt+D).

 

@alexey_nikityuk - Even if the process doesn't finish, something should output form the macro. The macro was purpose built for the original case and may not provide a universal solution. It you debug the macro, does the first iteration complete as expected?

 

I recommend starting new posts here on the Community so that any advice can be tailored to your specific scenarios and desired output. 

alexey_nikityuk
8 - Asteroid

Thanks a lot, @CharlieS! I indeed created a separate post here: https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Travel-itinerary-sequence/m-p/320846#M...

 

If you can help with iteration of the last WF that I posted there - i would be so grateful!

kunvai1
7 - Meteor

How long does this workflow take to run?

garretwalters12
8 - Asteroid

Why are both macro outputs iteration output set to Loop? I thought one should be set to "final" and the other set to "loop"?

 

Thanks!

KKnewbies
5 - Atom

@Charlie S, Your solution is great. I have difficulties in doing the similar question in advanced certification exam and your solution inspires me. I tried to replicate similar exercises with your solution. It runs well when data file has 255 or fewer entries. When the data file has 256 entries, the output trip number of final entries, the number assigned will be "Null" instead of 256. When data file have 257 (or more) entries,  the workflow will start endless loop.  Appreciate if I can get your advice on this.

Labels
Top Solution Authors