Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Union Tool : doesn't stack input #1 on top of input #2

Victouf
7 - Meteor

Hi everybody,

 

Just out of curiosity, I used a Union Tool and I was expecting it to stack the data from input #1 on top of the data from input #2 and it's not the case. 

 

It doesn't bother me at all since I can see the data has been added looking at the number of records. But still I was wondering why ?

 

Any idea ?

 

Best

7 REPLIES 7
atcodedog05
22 - Nova
22 - Nova

Hi @Victouf 

 

Union data generally get sorted on an ID column. If you want data to sorted in particular order ie #1 then #2 you can set the data order in the union tool.

 

Workflow:

atcodedog05_0-1629997115406.png

 

Hope this helps : )

BrandonB
Alteryx
Alteryx

You might want to check the box to specify which dataset comes first:

 

BrandonB_0-1629997164142.png

 

Victouf
7 - Meteor

Thanks, I thought that by default it was doing that. Otherwise do you know which rules by default it uses to stack the data ? 

BrandonB
Alteryx
Alteryx

Most of the time you are correct that it will stack the data based on the order that the tools were added. There are some scenarios, however, where due to the nature of the computations behind the scenes the sort order could be different. Therefore if you would like a guaranteed sort order I would recommend checking the box and specifying which input should be first/second/third/etc. 

atcodedog05
22 - Nova
22 - Nova

Hi @Victouf and @BrandonB 

 

My experience has been it sorts on the initial data order.

 

1. I have 10 random numbers

atcodedog05_4-1630000550774.png

 

2. Using filter I am splitting into odds and even numbers.

atcodedog05_2-1630000500464.png

 

 

3. After union in sort on the initial data order.

atcodedog05_3-1630000515418.png

 

In your data I couldn't make out how its sorting maybe join tool is interfering with the initial sort order😅

 

Hope this helps : )

Victouf
7 - Meteor

I couldn't find out either and thought maybe someone else could  😂 Thanks a lot for your help !

atcodedog05
22 - Nova
22 - Nova

@Victouf 

 

Maybe the join tool is interfering with the initial sort order 😅

 

Happy to help : )

Cheers and have a nice day!

Labels
Top Solution Authors