We've recently made an accessibility improvement to the community and therefore posts without any content are no longer allowed. Please use the spoiler feature or add a short message in the message body in order to submit your weekly challenge.
alteryx Community

# Weekly Challenge

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
###### IDEAS WANTED

We're actively looking for ideas on how to improve Weekly Challenges and would love to hear what you think!

Submit Feedback

## Challenge #307: Round-robin

10 - Fireball
Spoiler

Works regardless the number of players or weeks. It also accounts for 'odd' number of players to create 'bye' weeks.

5 - Atom

While looking through workflows and testing yours, I found that our outputs are nearly identical even though our initial workflows are very different.

Upon further inspection I found that my workflow works great with an odd number of teams, but falls apart completely(with duplicate matching) when an even number of teams is used. I was able to fix it to work properly with even teams by first identifying if the number of teams is even or odd, then, if even, removing one team, doing the combinations as if there were only (N-1) teams, then instead of filtering out results where Team A = Team B, change Team B to = Team N, and end up with completely unique results. IE. instead of filtering out "Bye" weeks the Bye week gets automatically matched with team N.

This also means odd teams need N weeks to have a "perfect" number of weeks to complete all combinations but even number of teams only need N-1 weeks to complete all combinations!

I've included a reference from the Wikipedia article about round robin tournaments to visually represent what the workflow is doing with Team 10 in a 10 team scenario

Spoiler

8 - Asteroid

my solution ;-)

Spoiler

15 - Aurora
Spoiler

8 - Asteroid

Can you tell me how the posted solution is correct?  If I run the solution with 5 teams and 15 weeks (which would be the number of weeks required for each team to play each of the other teams exactly three times, I get this:

This output only considers 3 teams (Teams 4 & 5 never play) and only one Team A vs Team B matchup per week.

It should have 50 rows where something like this is repeated 5 times (weeks 1-5; 6-10; 11-15):

How does the solution imitate a round-robin schedule?

15 - Aurora

It seems as though the wrong version was uploaded as the solution. I will upload a corrected version later, but in the meantime, change the Condition Expression in the Generate Rows tool to:

``teams <= tonumber("%Question.teams%")``

Currently, it is set to always equal 3 which is why you're seeing those results.

15 - Aurora
Spoiler
Updated workflow and iterative macro!
16 - Nebula
Spoiler

15 - Aurora
Spoiler

8 - Asteroid
Spoiler

As I was just doing AC #247 today as well, which asks for pretty much identical thing, so I've just changed column names and repurposed my old macro to do this one. 😄