Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

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.

SUBMIT YOUR IDEA

Challenge #59: Is it an Anagram?

JoeM
Alteryx Alumni (Retired)

The solution to last week's challenge can be found HERE.

 

This week, let's take a break from all of those business uses cases and have some fun! In this challenge, create a field that indicates whether two values in each row are anagrams for each other. An anagram is a word formed by re-arranging the letters of another word. In our case, all anagrams are one word and are not split to multiple. No letter can be used more than once, and all letters must be used.

 

MarqueeCrew
20 - Arcturus
20 - Arcturus

Good morning @JoeM,

 

In my response I also added a TEST to determine if my results are correct.  It turns out that I learned something new here that might be useful to others.  It concerns Yes and No.  This might be obvious to everyone, but I am a binary in nature and like boolean variables.  Your results were Yes and No, so I had to reformat my boolean (True/False) results.  After writing the workflow, I found that if you SUMMARIZE data and look for the Minimum value of a field, that No is the minimum of {Yes, No}.

 

Spoiler
Capture.PNG

Happy Mardi Gras!

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
alex
11 - Bolide

Here is my take on it. 

Spoiler
 Anagram Match.JPG
lbansal
5 - Atom

Here's my solution to the above.

 

Spoiler
 

 

Max06270
7 - Meteor

Hi guys,

 

My solution is below, it is not the very optimized but it does the work ;)

 

Spoiler
Capture.PNG

Have a great week!

Max

AdamR_AYX
Alteryx Alumni (Retired)

@alex Mine was very similar to yours but I used one more summarise than I needed to

 

Spoiler
challenge59.png

Now to think if I can do it in any less tools :)

Adam Riley
https://www.linkedin.com/in/adriley/
alex
11 - Bolide

Simple and quick!  Nice work.

Hartwick96
6 - Meteoroid

Here is my go at it!

AdamR_AYX
Alteryx Alumni (Retired)

OK I have a one tool solution :) (Technically two if the RecordId is required)

 

Spoiler
iif(REGEX_CountMatches([word1], "a")==REGEX_CountMatches([word2], "a")
&& REGEX_CountMatches([word1], "b")==REGEX_CountMatches([word2], "b")
&& REGEX_CountMatches([word1], "c")==REGEX_CountMatches([word2], "c")
&& REGEX_CountMatches([word1], "d")==REGEX_CountMatches([word2], "d")
&& REGEX_CountMatches([word1], "e")==REGEX_CountMatches([word2], "e")
&& REGEX_CountMatches([word1], "f")==REGEX_CountMatches([word2], "f")
&& REGEX_CountMatches([word1], "g")==REGEX_CountMatches([word2], "g")
&& REGEX_CountMatches([word1], "h")==REGEX_CountMatches([word2], "h")
&& REGEX_CountMatches([word1], "i")==REGEX_CountMatches([word2], "i")
&& REGEX_CountMatches([word1], "j")==REGEX_CountMatches([word2], "j")
&& REGEX_CountMatches([word1], "k")==REGEX_CountMatches([word2], "k")
&& REGEX_CountMatches([word1], "l")==REGEX_CountMatches([word2], "l")
&& REGEX_CountMatches([word1], "m")==REGEX_CountMatches([word2], "m")
&& REGEX_CountMatches([word1], "n")==REGEX_CountMatches([word2], "n")
&& REGEX_CountMatches([word1], "o")==REGEX_CountMatches([word2], "o")
&& REGEX_CountMatches([word1], "p")==REGEX_CountMatches([word2], "p")
&& REGEX_CountMatches([word1], "q")==REGEX_CountMatches([word2], "q")
&& REGEX_CountMatches([word1], "r")==REGEX_CountMatches([word2], "r")
&& REGEX_CountMatches([word1], "s")==REGEX_CountMatches([word2], "s")
&& REGEX_CountMatches([word1], "t")==REGEX_CountMatches([word2], "t")
&& REGEX_CountMatches([word1], "u")==REGEX_CountMatches([word2], "u")
&& REGEX_CountMatches([word1], "v")==REGEX_CountMatches([word2], "v")
&& REGEX_CountMatches([word1], "w")==REGEX_CountMatches([word2], "w")
&& REGEX_CountMatches([word1], "x")==REGEX_CountMatches([word2], "x")
&& REGEX_CountMatches([word1], "y")==REGEX_CountMatches([word2], "y")
&& REGEX_CountMatches([word1], "z")==REGEX_CountMatches([word2], "z"),
"Yes", "No")
Adam Riley
https://www.linkedin.com/in/adriley/
MarqueeCrew
20 - Arcturus
20 - Arcturus

@AdamR_AYX,

 

You're my hero

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.