Hi community !
I come up with a question that I think, you will solve easily, but that I can't figure out.
I have few rows containing many words and my goal is to title case the first word only. I've tried formulas and regex but can't find a way to achieve it.
I could split my rows word by word, add a record ID and if the ID is 1 title case the word then concatenate back but I'm sure there is a simpler way to do this.
Do you have any idea ?
Thank you for your replies and I hope that everybody is fine !
Have a great day 🙂
Cheers,
Jean-Baptiste
Solved! Go to Solution.
Hi @Jean-Balteryx ,
Can you split the first word and rest of the string into 2 columns using Text to column.
Use a formula tool to titlecase the first word and later concatenate with rest of the sentence.
Hi hope this helps.
Cheers and Happy Analyzing : )
Hi @atcodedog05 ,
Thank you for your solution ! 🙂
I think I can split in two using a Regex tool ! I'll try it.
I'm also looking for a solution that doesn't need to split the row but I'm not sure it's possible.
Cheers !
Jean-Baptiste
Found this. You accomplish the task with only a formula tool.
https://community.alteryx.com/t5/Alteryx-Designer-Ideas/Custom-Functions/idi-p/467216#M9578
Sorry it was a submitted idea.
You can use REGEX_Replace([FieldName], " (.*)\s.*", TitleCase(#1))
I currently dont have access to Alteryx to check. But the formula would look like that.
Hi @atcodedog05 ,
I tried with REGEX_REPLACE but somehow the function TitleCase or any other isn't applied. 😕
Jean-Baptiste
Hi @Jean-Balteryx ,
I got access to my designer and was able to work it out.
Here is the hack. This was a great exploration for me too.
The formula.
I hope this helps. Would love to hear back from you.
Hi @Jean-Balteryx
If by Title Case on the first word, you can split off just the first character and make it uppercase, then leave the rest of the string as is.
In a formula tool, you can use:
Uppercase(Left([Field],1))+right([Field],Length([Field])-1)
This takes the first character of the string, makes it uppercase, and then joins to the remaining characters in the string (from the right side, take the total length of the string and subtract 1 because we've already dealt with the first character)
Let me know if that helps
Cheers!
Esther
@atcodedog05 , it's the power of solving together! One idea triggers another. That's what I love most about this community!!
Cheers,
Esther
Hi @estherb47 and @atcodedog05 ,
You are both awesome, your solutions work ! You saved the day !
I love to see this solving process every time !
Thank you very much 🙂
Cheers,
Jean-Baptiste