# Weekly Challenge

Solve the challenge, share your solution and summit the ranks of our Community!
New content is available in Academy! You may need to clear your browser cache for an optimal viewing experience

## Challenge #59: Is it an Anagram?

Highlighted
Director, Customer Enablement

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.

Alteryx Certified Partner

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

Happy Mardi Gras!

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Highlighted
11 - Bolide

Here is my take on it.

Spoiler

Highlighted
Alteryx Partner

Here's my solution to the above.

Spoiler

Highlighted
7 - Meteor

Hi guys,

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

Spoiler

Have a great week!

Max

Highlighted
Alteryx

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

Spoiler

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

Principal Software Engineer
Highlighted
11 - Bolide

Simple and quick!  Nice work.

Highlighted
6 - Meteoroid

Here is my go at it!

Highlighted
Alteryx

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")