Alteryx Designer Desktop Discussions

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

Fantasy Football Simulation - Help

davidwwyche
6 - Meteoroid

I am trying to develop a fantasy football Monte Carlo simulation with the following constraints:

 

Necessary:

12 teams (every team plays every other team at least once)

14 weeks (weeks 12,13, and 14 always repeat weeks 1,2, and 3, respectively *effectively this is an 11 week season and last 3 weeks can just repeat the first 3*)

N number of seasons

 

I would like a dataframe with the following columns: season, team, week where the values are the respective opponents for each team for each week during the respective season.  If  team 'a' is playing team 'd' in week 3 of season 142; then team 'd' also must play team 'a' in week 3 of season 142. 

 

I have tried this in both R using loops and alteryx, but I seem to be getting stuck having constraints in both dimensions - opponents must play each other in the same week, and can only play each other once (in the first 11 weeks).  Have not worked previously with iterative macros, so this will be completely new for me.

 

 

2 REPLIES 2
gabrielvilella
14 - Magnetar
davidwwyche
6 - Meteoroid

Thanks, that was really helpful.  My loop is really slow to run - ~5.9 seconds each iteration.  So with 2 teams/week on each loop and 12 teams/week*11 weeks/season*N seasons it's going to take a really long time.  I've attached my workflow with macro and input file - is there any way to speed this up? 

Labels