on 10-21-2016 06:28 PM - edited on 04-20-2023 07:49 PM by yhchen
This article is part of the Tool Mastery Series, a compilation of Knowledge Base contributions to introduce diverse working examples for Designer Tools. Here we’ll delve into uses of the Text To Columns Tool on our way to mastering the Alteryx Designer:
Easily the most used tool in the parsing category, the Text To Columns Tool makes for an extremely quick dicing of delimited fields. To use it you only need to specify a delimited field, delimiter(s), whether you’re parsing to rows or columns (you’ll need to specify a number of columns to parse into with this selection) and you’re off. Any way you slice it, this tool has you covered:
Note: The Text To Columns Tool will also accept multi-character delimiters (example attached in MultiDelimiter.yxmd):
When using selection-based tools, the output will often be a concatenated string of all your selections:
To use the List Box Tool output from the above in your analytic apps (master them here), simply update a placeholding string in a Text Input Tool with an Action Tool (master it here). Then apply some Text To Columns magic to parse the selections into rows of keys that you can easily join(master the art of joining here) back to your input data set for the record filtering.
The parsed Interface Tool output will look like the below:
The approach in the app should resemble:
Don’t know how many columns your field will be parsed into? There’s a useful trick to avoid specifying – if you assign a Record ID(master the tool here) and use the Tile Tool (master it here) to count each occurrence of your records (Tile_SequenceNum) you can then Cross Tab (master it here) them back into the table shape you would have had anyway (example attached in ParseIntoRows.yxmd):
By now, you should have expert-level proficiency with the Text To Columns Tool! If you can think of a use case we left out, feel free to use the comments section below! Consider yourself a Tool Master already? Let us know at community@alteryx.com if you’d like your creative tool uses to be featured in the Tool Mastery Series.
Stay tuned with our latest posts every Tool Tuesday by following Alteryx on Twitter! If you want to master all the Designer tools, consider subscribing for email notifications.
Additional Information
Click on the corresponding language link below to access this article in another language -
Portuguese
Spanish
French
German
Japanese
How do I include multiple delimiters in the text to column?
here in my case, I want to include numbers from 0 to 9 as delimiters.
Please help.
I enjoy the Text To Columns tool! It is one I always find useful in diverse situations.
This tool is such a great help in parsing big data set in Alteryx. There is no need to parse the data in excel before loading it to Alteryx.
This is a great tool for working with CSV files. Very useful
A much more advanced version of a similar Excel tool.
Excel makes it really dificult when it can be super easy!
I have a column that contains the month and year with a field type of String:
Period
012012
Note there are no delimiters. How can separate the month and year into 2 separate columns?
Month Year
01 2012
The original data will always be structured as mmYYYY. This data will later be joined to data that is V_WString. Prior to joining, should I change the field type from String to V_WString to match the data from other sources? It will not be used later for any reason. I am simply trying to have my columns align for the join.
@jem242
Instead of Text to Columns, did you explore using substring function?
Substring(x, start, length): Returns the substring of (x) starting at (start), stopping after(length), if provided
@VamsiK
I decided to combine the others instead. It was the path of least resistance. But I will definitely keep that in mind.
How can i parse from right to left? C:\Directory1\Directory2\, i need to catch just the last one ("Directory2" in this example) from each row. thanks.
Oi @Felipe_Ribeir0, tudo bem?
For more visibility, you can always start a new topic in our discussions board to get assistance with your questions. Also, if you haven't checked yet, we have a Community dedicated to our Portuguese speakers. In fact, we do have this Knowledge Base article in there too.
Happy to see you around!
The text to column tool is a great function, makes the data presentable.
How does the text to column tool handle null values- does it just leave it there?
I agree, the text to column is very helpful, even split the rows
This is interesting and very helpful. Thank you.
hhtps://community.altery.com/t5/alteryx-community-english/ct-p/externa
This tool is such a great help in parsing big data set in Alteryx. There is no need to parse the data in excel before loading it to Alteryx.
cool
I also enjoying the text to column tools to separate the one column into multiple
This tool is such a great help in parsing big data set in Alteryx. There is no need to parse the data in excel before loading it to Alteryx.
Why create 5 columns in the first example when it only required 4?
@SeanBain1965 Because there were two colons in the original field, which resulted in an extra empty column (which is later cleaned up with the Dynamic Select tool).
I found it helpful.
I think there is a missing step before dynamic rename. The input should be sorted by column 1 descendingly then use dynamic rename. After that we may do sort the ID column ascendingly.
very informative