Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Combining two data sets

ToddCheever-FMR
6 - Meteoroid

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:

DS1C1DS1C2DS1C3DS1C4DS1C5
DS1R1DS1R1DS1R1DS1R1DS1R1

 

Data Set 2:

DS2C1DS2C2DS2C3DS2C4DS2C5DS2C6
DS2R1DS2R1DS2R1DS2R1DS2R1DS2R1
DS2R2DS2R2DS2R2DS2R2DS2R2DS2R2

 

Desired Output:

DS1C1DS1C2DS1C3DS1C4DS1C5 
DS1R1DS1R1DS1R1DS1R1DS1R1 
DS2C1DS2C2DS2C3DS2C4DS2C5DS2C6
DS2R1DS2R1DS2R1DS2R1DS2R1DS2R1
DS2R2DS2R2DS2R2DS2R2DS2R2DS2R2

 

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"

11 REPLIES 11
cjaneczko
13 - Pulsar

Sounds like you want to use the Union tool if you are stacking the two sets of data.

ToddCheever-FMR
6 - Meteoroid

@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.

cjaneczko
13 - Pulsar

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.

 

image.png

MarqueeCrew
20 - Arcturus
20 - Arcturus

@ToddCheever-FMR 

 

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 :)

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
ToddCheever-FMR
6 - Meteoroid

Can I just add an empty column? is there a tool that does that?

cjaneczko
13 - Pulsar

You can but it has to have a header name (field name). It cant be blank.

MarqueeCrew
20 - Arcturus
20 - Arcturus

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

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
ToddCheever-FMR
6 - Meteoroid

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. 

 

DS1C1DS1C2DS1C3DS1C4DS1C5DS1C6
DS1R1DS1R1DS1R1DS1R1DS1R1DS1R1
DS2R1DS2R1DS2R1DS2R1DS2R1DS2R1
DS2R2DS2R2DS2R2DS2R2DS2R2DS2R2

 

In this instance DS1C6 is my new blank column. I want to preserve the headers from DS2 for the purposes of this report.

MarqueeCrew
20 - Arcturus
20 - Arcturus

@ToddCheever-FMR 

 

Sent you a PM offering you online assistance now via Zoom

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Labels