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

Alteryx Designer Desktop Discussions

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

How to use the FindString function with a column name as parameter?

GraceK_dup_114
7 - Meteor

Hi everyone!! 

 

I have a dataset with a first column named "full path" that contains string elements. I have 68 others columns names "LI00A1", "LA00B4", "LI01A8", etc...that are all empty columns. I would like to fill those empty columns by saying to alteryx for each line of those columns : if [full path] contains the name of my column, then give me its position in the string (FindString), if not give me nothing (or -1 as it already does, whatever), and reply this formula on the next 68 columns. Does anybobody have an idea? 

 

For example : for filling my column "LI00A1", I want to say to alteryx FindString([Full path],"LI00A1"). But, as each 68 column names are differents, I don't want to have to type 68 different formulas for each column, but instead I would like to find a way of replacing "LI00A1" by a colum name parameter, and to say to alteryx to replicate this formula for the 68 columns. I hope it's pretty clear... 

 

Thanks in advance,

 

Grace

5 REPLIES 5
afv2688
16 - Nebula
16 - Nebula

Use the multifield formula:

 

Untitled.png

 

Cheers

GraceK_dup_114
7 - Meteor

Hi, 

 

Thank you for your quick answer! It's not working, I don't know why. I've tried with the exact same parameter you've put in the multiple column formula, but when I extract the table, the columns are stille empty. 

 

BR,

 

GraceScreen_shot_Aleryx_First_try.jpg

GraceK_dup_114
7 - Meteor

ps : the screen shot has not the same parameter the output type and size (V_Wstring and 255) but I've also tried with the same that you'd put, and it gave the same result : empty columns

afv2688
16 - Nebula
16 - Nebula

But were the new colums created? Are they also empty

 

If you want your columns to be replaced you have to uncheck the 'Copy output Fields Add' and the 'Change output Type to' ->String Or Double

 

cheers

GraceK_dup_114
7 - Meteor

It works thank you!!

Labels