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

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Length between each letter in a string

fomenter
8 - Asteroid

Hi,

 

I wonder if I can measure the lenght between each letter in a string of text. Only first and the last letter are positives (M and N), characters between first and last letter (A and I) are negatives

 

Example: Main

 

             M(13TH letter)-A(1st letter)-I(9th letter)+N(14TH)=13-1-9+14=17

 

Maybe it is a long shot but worth to try. Thanks in advanced

4 REPLIES 4
JohnJPS
15 - Aurora

I'm guessing there may be an easier way but this seems to work; (workflow attached)

Capture.PNG

 

fomenter
8 - Asteroid

OMG! You are awesome. I ll try this as soon as I get back to work, but thank you for trying!!!

BenMoss
ACE Emeritus
ACE Emeritus

Great answer John.

 

I had a look at your workflow and made it slightly more concise

workflow.png

attached is the workflow.

In the example from the OP the workflow I have created converts - MAIN to 13, -1, -9, 14 = 17. Another example from mine would be HELLO converts to 8, -5, -12, -12, 15 = -6


In comparison Johns workflow converts - MAIN to 11, 1, -7, 12. and HELLO to 6, -3, -10, -10, 13 = -4.

Not to sure on why this discrepency exists, maybe it's a difference in our interpretation of the question and example given.

Regards,

Ben

JohnJPS
15 - Aurora

Great stuff @BenMoss, can't believe I didn't think of MultiRow formula!  (I've also fixed my earlier link, for anyone wandering through.)

Labels
Top Solution Authors