Text To coloumn filed - Dynamically
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I used text to column tool to split the data but my Field names are dynamic and not always the same, and sometimes the input file is blank. my requirement is to change the filed name dynamically in Text to column tool and it should run even we don't have input field/file.
Currently i changing the text to column field name always manually, Please provide the dynamic solution.
My sample flow provided in the attachment as a screenshot, Thanks in advance.
Solved! Go to Solution.
- Labels:
- Developer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Vishwak
Here is a solution for dynamically changing the field name to Field1, so it doesn't matter what the original field name is.
Use a Field Info tool, add in RecordID and Crosstab (Record ID becomes the column header, Name becomes the column), use the Dynamic Rename tool to add 'Field' as a prefix, and then Union the original data back.
Workflow example attached (credit to the solution provided here https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Column-headers-as-first-row-of...)
Regarding your query on the blank input file its hard to provide a solution based off your screenshot as it looks like there is just that field flowing in? One option is to use a Count Records tool to control the flow but you also need to decide what happens to the whole process if no data is available
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@Vishwak
David solution will work if the fields are in the same position in each of the files, however will not work in the field will be located in different position in the different documents, such as in one document is column A while in the other one it will be column C.
If you know what are all the possible variations of the different headers, you can create a mapping file and then set let say Field1 and use Dynamic Renaming tool to rename the different variations to Field1 and then you are good.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks a lot.
