Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Join 2 columns in same report

Hi2023
8 - Asteroid

I have 2 columns that need to be combined as one, whats the best way to merge these 2 columns?

 

7 REPLIES 7
ShankerV
17 - Castor

@Hi2023 

 

the best way is to use union tool.

 

Many thanks

Shanker V

DataNath
17 - Castor

Hey @Hi2023, do you just simply want to combine them like this? 

DataNath_0-1669039571601.png

 

Or do you mean they're coming from 2 separate sources and you need to do a join of the two tables?

ShankerV
17 - Castor

Hi @Hi2023 

 

Please find the below use case.

 

Input:

 

ShankerV_0-1669039961244.png

 

Output:

 

ShankerV_1-1669039972141.png

 

 

Many thanks

Shanker V

 

 

 

ShankerV
17 - Castor

@Hi2023 

 

Workflow:

 

ShankerV_0-1669040005316.png

 

 

Step 1: Input

Step 2: Select tool

 

ShankerV_1-1669040025648.png

 

Step 3: 

 

ShankerV_2-1669040043322.png

 

 

Step 4:

 

ShankerV_3-1669040060628.png

 

 

Many thanks

Shanker V

 

 

ShankerV
17 - Castor

 

@Hi2023 

 

My solution will work even for huge datasets too.

If you want to remove the duplicates, then you can use unique tool to remove the duplicates.

 

Kindly accept this solution if it provided a solution to your question.

 

Many thanks

Shanker V

DQAUDIT
9 - Comet

@Hi2023 

 

Depending on your exact requirements for combining, you can also use a Formula tool, to determine which column's value to use.

 

For example, assume you have data like this below and you want to combine Column1 and Column2:

 

RecordIDColumn1Column2
1A[Null]

 

 

You could create a "New Column" with the following expression:  IF IsNull(Column1) Then Column2 ELSE Column1 ENDIF

 

DenisZ
11 - Bolide

If you want to combined them under each other then union. If they have some unique ID in both and you want to combined them horizontally, then the join tool and joining by the unique value. 

Labels