Flatten Data which have different number of columns
- 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
Hi All,
I'm trying to flatten my data into only 3 columns, (1 for the line item, 1 for the column name, and 1 for the value). The issue for me right now is that line items that start with 1, have 2 columns. Then line items that start with a 2 have 4 columns and so on. Thus, it makes it difficult to transpose given that each line item has a different amount of columns.
So this is the data originally:
This is the objective (after being flattened)
I have created an Alteryx workflow to solve this (I have attached this below).
Just to explain what I've done:
1) Multi-row Tool: To allocate a Record ID to each line item
2) Filter tool: Filter for each Record ID (can group them if they have the same column headers and the same amount of them)
3) Select tool: Remove any columns with null values
4) Dynamic rename tool: Take the first row as headers
5) Filter tool: Remove the rows where there aren't any values we want to transpose
6) Transpose tool: Make the data flat
7) Union tool: Union all the data together
However, is there anyway to do this without allocating a Record ID and filtering it based on the amount of columns the line item has? I have to do a similar exercise for 40 different data inputs, so it'll take forever for me to configure to record ID tool and the select tool to match each data set.
Thank you for your help
Solved! Go to Solution.
- Labels:
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi apathetichell,
Thank you for taking time out to help me with my issue. Unfortunately, I'm running an older version of Alteryx and wasn't able to open your Workflow. Can you please tell me how you configured the batch macro tool?
Really appreciate it!
Regards,
Andy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@Andyhjtran
Check this one for the downgrade.
https://community.alteryx.com/t5/Alteryx-Designer-Discussions/How-to-downgrade-packaged-workflow-Fil...
@atcodedog05
Where is your latest post on downgrading workflows, I can not find anywhere. 😁
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@atcodedog05
Thanks.
I though I put it in the bookmark. 😁
