alteryx Community

# Weekly Challenges

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

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

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

## Challenge #144: Secret Santa Assignments (BAH HUMBUG!)

5 - Atom

@KyleCollins wrote:

Got the answer as shown in the output, but this was assuming that everyone was giving to and receiving from the same person. Wouldn't a true secret santa have 50 random pairings?

Great Point! If your match is also your Secret Santa, it's not much of a secret, is it? I might need to recreate my workflow

UPDATE: Here's my updated workflow. This will provide 50 unique results, randomized with every run, and the "scroogieness" will never be greater than 13.

Spoiler

6 - Meteoroid

As bsanson points out, pairings aren't very secret if you know the person you're gifting to is your secret santa.  The best answer is 50 unique rows, not 25 pairs.  And each run in this module creates new pairs.

Spoiler

14 - Magnetar

My first challenge in a long time - good to be back!

Spoiler

6 - Meteoroid

My first submitted challenge, this was fun!

7 - Meteor

8 - Asteroid

Merry Christmas! Here's my solution:

Spoiler
First time trying out the count tool - will have to remember that one!

8 - Asteroid

Very fun challenge!  I actually took a slightly different approach than the solution that wasn't really "Secret" Santa, since each person knew who they would receive a present from.  My workflow instead creates 50 unique pairs (sometimes there will be duplicated pairs, but it would be by chance through random number generation).

Spoiler

8 - Asteroid

This is my FIRST challenge!!! So fun!!!

11 - Bolide

I created two very simple solutions, one that generates 25 Secret Santa pairs that are assigned to each other, and one that assigns a truly Secret Santa for each of the 50 people on the list.

Spoiler

13 - Pulsar

This one was pretty fun! I did it both ways (method #1: simple match with 25 pairs, and method #2: secret match with 50 unique pairs). I may have gone overboard on method #2, but wanted to ensure unique pairs (with no givers/receivers buying for each other), while also minimizing the net scrooginess.

Spoiler
Outer workflow:

Iterative macro:
The macro picks a giver in order of increasing scrooginess (randomized within each scrooginess score). Then, the macro picks from remaining available receivers,  in order of decreasing scrooginess (randomized within each scrooginess score). The macro iterates until everyone has been picked as a receiver. The macro picks without replacement, ensuring we get distinct pairs with no givers/receivers buying for each other, and also ensuring that we keep net scrooginess as low as possible.