Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

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 #458: Masking Alternating Characters

PhilipMannering
16 - Nebula
16 - Nebula

Solution attached.

 

Spoiler
image.png
KLTerrell
8 - Asteroid

@PhilipManneringcool RegEx solution! 

nSpire
10 - Fireball
Spoiler
458.png

oscar_leeper_wf
7 - Meteor

I couldn't quite replicate the output, but here's some version of it using an iterative macro for practice and less code than I'd usually use for fun.

Screenshot 2025-01-06 140110.png

 

Spoiler
Screenshot 2025-01-06 140010.pngScreenshot 2025-01-06 140025.png
3I_ATLAS
9 - Comet

I think there's a minor error in the provided solution as it does not mask the first character of the 2nd record and it should be masked according to the instructions and provided example.  Since the mask/not mask resets with a new record and every 1st character should be masked.  I used a long formula to account for that.

Spoiler
if [Data]=' ' then
0
elseif [Row-1:RecordID] != [RecordID] then
1
elseif [Row-1:MaskFlag]=1 and [Row-1:RecordID] = [RecordID] then
0
elseif [Row-1:MaskFlag]= 0 then
1
ELSE
99
ENDIF

WC_458.jpg
3I_ATLAS
9 - Comet

Phenomenal use of RegEx by PhilipMannering above.  Check out his 1 tool solution!

 

ggruccio
ACE Emeritus
ACE Emeritus

It took me a while to get the logic (longer than the programming).  Great puzzle!

Spoiler
Screenshot 2025-01-06 180942.png
armani_h
5 - Atom

Thanks for posting this solution! I was curious to know why you chose to use the following expression in your Multi-Row Formula tool and a breakdown of what it means - specifically the Row-1 part?: IF Regex_Match([Data],"\s") THEN 0 ELSE [Row-1:Character Number]+1 ENDIF

Yoshiro_Fujimori
15 - Aurora
15 - Aurora

My solution.

Spoiler
Workflow
workflow.png
Multi-Row Formula
[Data] = 
  IF [Row-1:RecordID] = 0
  THEN "*"

  ELSEIF [Row-1:Data] != "*"
     AND [Data] != " "
  THEN "*"

  ELSE [Data]
  ENDIF
Qiu
21 - Polaris
21 - Polaris

In my interpretion, it states that "Your task is to mask every other letter in a word with an asterisk. " but the answer is consistent with "Space" wise.

Spoiler
Challenge458.png