Alteryx Designer Desktop Discussions

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

Creating NHL or NBA style fixture

nic_hamley
7 - Meteor

Hi there,

 

I'm looking at doing an NHL or NBA style regular season fixture for an online league where each player takes one of the team names. I want to be able to create a fixture/schedule that is similar to that of the NHL or NBA. For instance, 32 teams across 4 divisions in two conferences. I'm not entirely sure how these leagues do their fixturing but something basic like:

  • Play everyone in you division 3 times (21 games per team as you would play each of the other seven teams in your conference 3 times)
  • Play everyone else in your conference twice (Another 14 games per team as you would play each of the teams from the other division in your conference twice)
  • Play everyone in the other conference once (Another 15 games per team as you would play each of the teams from the other conference, regardless of division, once)

For a total of 50 games for each team.

 

Is there a way to use Alteryx to generate this? I wouldn't need it split by round or anything but just making sure each team plays that number of games would be pivotal. Has anybody tried this before?

 

Thanks!

5 REPLIES 5
BrandonB
Alteryx
Alteryx

I feel like I am really close, but I am seeing 53 as the total game count for each team. Basically I append the teams together then dedupe the situations where team 1 plays team 2 vs team 2 plays team 1 scenarios. Then I use the generate rows tool to create the corresponding number of games between teams. 

 

Workflow is attached for you to take a look! If you want to get real fancy you could turn the append up until right before the generate rows tool into a macro because it is the same steps performed at each level. 

 

Game Calculator.png

BrandonB
Alteryx
Alteryx

For these two points:

 

  • Play everyone else in your conference twice (Another 14 games per team as you would play each of the teams from the other division in your conference twice)
  • Play everyone in the other conference once (Another 15 games per team as you would play each of the teams from the other conference, regardless of division, once)

Wouldn't everyone else in your conference be everyone in the other division? If this is the case and there are 8 teams in the other division, wouldn't that be 16 games?

 

Similarly, if you play everyone in the other conference once, wouldn't that also translate to another 16 games?

 

If that math checks out then it is 21+16+16 which is 53. If I missed something please let me know!

nic_hamley
7 - Meteor

Ah yes, that sounds right @BrandonB ! Apologies, I was getting my numbers confused.

BrandonB
Alteryx
Alteryx

No worries! It was a fun evening Alteryx challenge. You can swap out the values in the Text Inputs in the team names and I think should be well on your way for setting up a schedule. 

nic_hamley
7 - Meteor

@BrandonB This solution worked and is really awesome. A more advanced question, is there a way of making sure that all teams have nearly a 50/50 split of home and away games? And also how would you then randomise it to evenly distribute the games throughout?

 

Labels