Hey all!
I'm currently using Alteryx to create a model to analyze bus routes in the U.S., and have an interesting idea I would like to implement, but am confused on how to do so.
I've created a model that takes a list of possible bus trips (i.e. Washington D.C. to New York to Boston/Philadelphia to New York) and along with a score of how likely a passenger is to travel that trip on that route. My model predicts a certain number of passengers will travel that route over a period of time, and I have actual seat numbers for each route as well.
For bus trips where predicted passengers are greater than capacity, I'd like to reallocate them to lower "scored" trips. For example:
I imagine this involves a combination of the running total and multi-row tools, but wanted to get some advice as an Alteryx beginner. My sample data is below and any advice you could provide would be appreciated!
Best,
-Shay
Solved! Go to Solution.
Hi,
Your approach, as far as I understood is good. But I believe that an iterative macro would do a better job on this.
The principle of allocating passengers, as you described, fits well with an iterative macro process, where the macro's left over passengers will be then used for the accomodations on the next route.
Edit #1: I found this awesome article in the Community, that may clarify the process I mentioned above.
http://community.alteryx.com/t5/Alteryx-Knowledge-Base/CS-Macro-Dev-Iterative-Macros/ta-p/10303
Definitely agree that an iterative macro would be useful and have seen that post in the community, but would you have specific thoughts about how to implement this in an iterative macro?
No worries if not - I was just curious if you had any ideas!
Thanks so much for this - it's incredibly helpful!
Is there any way to incorporate the "share of overall preferability score" into the calculation, however?
Definitely didn't realize the multi-row formula was so powerful - thank you again!
You are most welcome. A fun challenge to learn on :)