Combining two data sets
- 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
Hello All! So I am looking to combine two data sets into 1 for a report. Data Set 1 is more of a header with specific columns on it; Data Set 2 is what I'm looking to load but both data sets need to be on one report in order for it to work how I'm designing it.
Data Set 1:
DS1C1 | DS1C2 | DS1C3 | DS1C4 | DS1C5 |
DS1R1 | DS1R1 | DS1R1 | DS1R1 | DS1R1 |
Data Set 2:
DS2C1 | DS2C2 | DS2C3 | DS2C4 | DS2C5 | DS2C6 |
DS2R1 | DS2R1 | DS2R1 | DS2R1 | DS2R1 | DS2R1 |
DS2R2 | DS2R2 | DS2R2 | DS2R2 | DS2R2 | DS2R2 |
Desired Output:
DS1C1 | DS1C2 | DS1C3 | DS1C4 | DS1C5 | |
DS1R1 | DS1R1 | DS1R1 | DS1R1 | DS1R1 | |
DS2C1 | DS2C2 | DS2C3 | DS2C4 | DS2C5 | DS2C6 |
DS2R1 | DS2R1 | DS2R1 | DS2R1 | DS2R1 | DS2R1 |
DS2R2 | DS2R2 | DS2R2 | DS2R2 | DS2R2 | DS2R2 |
Essentially, I'm just looking to plop Data Set 1 on top of Data Set 2.
Right now I'm sitting at both data sets having been "selected"
Solved! Go to Solution.
- Labels:
- Datasets
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Sounds like you want to use the Union tool if you are stacking the two sets of data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@cjaneczko - I thought this as well but the union tool keeps mashing my data together because it's looking for the columns to be similar I think. I'm relatively new to Alteryx as well so it's completely possible that I'm misusing the union tool.
I can't get it to cleanly stack the two sets of data without messing up my columns. The header data set columns are different than the body data set columns.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
So the field header to the right of DS1C5 cant be blank, It would need to be called something. If you choose auto config by Position this will stack them. But the header will update at the top with the lower data sets header info.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
According to ChatGPT:
Certainly! You can combine Data Set 1 and Data Set 2 using Alteryx in a few simple steps:
1. **Input Data:** Add two Input Data tools for Data Set 1 and Data Set 2.
2. **Union Tool:** Use the Union tool to combine both datasets. Make sure to align columns with similar data types.
3. **Select Tool:** Add a Select tool to arrange the columns in the desired order if needed.
4. **Output Data:** Finally, use an Output Data tool to save the combined dataset as a single file or output for your report.
By following these steps, you'll have a single dataset that combines Data Set 1 and Data Set 2, which can be used for your report as per your design.
Cheers :)
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Can I just add an empty column? is there a tool that does that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You can but it has to have a header name (field name). It cant be blank.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
If you have CReW macros, yes. https://marketplace.alteryx.com/en-US/apps/420743/crew-ensure-fields
Otherwise a formula tool can be used to create the field for you.
Cheers,
Mark
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This isn't quite accomplishing what I need. I inserted a column named "Blank" into the header using the formula tool. When I use the union tool it strips the headers from Data set 2 and forces everything to have the header from Data Set 1.
DS1C1 | DS1C2 | DS1C3 | DS1C4 | DS1C5 | DS1C6 |
DS1R1 | DS1R1 | DS1R1 | DS1R1 | DS1R1 | DS1R1 |
DS2R1 | DS2R1 | DS2R1 | DS2R1 | DS2R1 | DS2R1 |
DS2R2 | DS2R2 | DS2R2 | DS2R2 | DS2R2 | DS2R2 |
In this instance DS1C6 is my new blank column. I want to preserve the headers from DS2 for the purposes of this report.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Sent you a PM offering you online assistance now via Zoom
Cheers,
Mark
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
