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

Picking out the middle name

Shounak
6 - Meteoroid

Hello everyone,

 

I am new to alteryx, have been working on it for a couple of months now. I have this issue for gender calculation from a given name, Now the names are in the below format, so the middle part gives away the gender which I will be replacing with a given gender code. For that I need to be able to pick out only the middle part of the name. An example:

 

I have this name field with data like: John SonOf Doe, Jane d/o Doe.

 

Any idea what function to use for this?

 

Thank You.

7 REPLIES 7
LordNeilLord
15 - Aurora

Hey @Shounak

 

Could you use the Contains() function in the formula tool to identify the gender?

 

For example:

 

If Contains([Field1], "SonOf") then "Male"

Elseif  Contains([Field1], "d/o") then "Female"

Else Null()

Endif

 

 

If you can provide an example datatset we can help you further :)

 

@LordNeilLord

Part time Tableau, Part Time Alteryx. Full Time Awesome


Data Lover

Shounak
6 - Meteoroid

hello,

 

Thanks for your reply on this. I actually have thought of using the if else, but if any other format of "son of" of "s/o" comes up then Ive to modify the formula each time. Hence I am using a way, where I take the name field, take out the middle part of the names like the above mentioned, then find/replace with the master file which has the gender defined in 2 fields.

 

Gender Code     Gender

d/o                    Female

s/o                    Male

Son of               Male

 

Something like the above.

I will attach the sample file for the name field. To pick out the middle part is the only issue I am unable work out.

 

Thank You.

LordNeilLord
15 - Aurora

Ahh ok, 

 

In that case yes...using Find & Replace is probably the way to go....see attached example.

 

 

Shounak
6 - Meteoroid

This works.

 

But I tried getting the same data that u took from a text input, but from a .csv masterfile. Doesnt seem to work so I tried with parsing the middle character and then sending only s/o d/o to be found and be replaced.

 

Thanks =)

Shounak
6 - Meteoroid

ps

 

I believe the correct word i should use is to Parse the middle name out.

LordNeilLord
15 - Aurora

Ok, so if you want the Parse out the "middle" part of the field you can use the RegEx parse function:

 

RReplace4.PNG@LordNeilLord

Part time Tableau, Part Time Alteryx. Full Time Awesome


Data Lover

Shounak
6 - Meteoroid

Thanks a ton :)

 

Now i have 3 solutions.

Labels