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

Alteryx Designer Desktop Discussions

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

Join without multiplying the data

asi_272829
5 - Atom

Hello there,

 

I'm trying to find the solution for my work flow. I'm not sure someone already touched this topic as I can't find any previous solutions for this so I'm seeking for your expertise.

 

I have for example 2 sets of data below: 

 

asi_272829_0-1685005600869.png

And I want the result comes out like this:

asi_272829_1-1685005741215.png

If I do the JOIN, it will end up multiplying the data (see result below) and I'm struggling for a solution. Does anybody already deal with this issue before? I'm very much appreciated for your help!

asi_272829_2-1685005960323.png

Many thanks in advance.

 

 

 

5 REPLIES 5
FrederikE
13 - Pulsar

Hey @asi_272829,

 

This is quite interesting. You require the Join tool to do a mix of Joining on ID and on Record Number.

I was able to build this using a batch macro - this might be overcomplicated but it works.

 

FrederikE_0-1685007660091.png

FrederikE_2-1685007733317.png

 

FrederikE_1-1685007686099.png

 

 

Raj
16 - Nebula

Simple and efective

Hope this help

 

 

hlee36
8 - Asteroid

The simplest way to solve this issue would be using the tile tool as below.

 

hlee36_0-1685160455769.png

The reason why the multiplication of data happens is due to the lack of a unique identifier when joining two datasets. 

 

"ID" in both tables are not "unique" because ID of 2 has a def value of b, c and d in table A and ID of 3 also has multiple values e and f.

 

To solve the problem of not having a unique identifier, we can use tile tool to make another field and assign values to each row. 

 

Then, the combination of two attributes (ID and Tile_SequenceNum) will be a unique identifier so that only one row can have one combination of ID and Tile_SequenceNum in both Tables. 

 

Then, we can join two tables using our unique identifier as below.

 

hlee36_2-1685160902413.png

 

 

We can now drop the Tile_Num and Tile_SequenceNum that we used to combine these two tables. But, feel free to keep them if you may need them.

 

hlee36_1-1685160478495.png

 

 

flying008
15 - Aurora

Hi, @asi_272829 

 

Another way is so easy for you:

录制_2023_05_27_14_40_34_681.gif

The Join tool detail set as @hlee36 said above.

 

flying008_0-1685169920820.png

 

 

asi_272829
5 - Atom

Hi all, thanks a lot for your helps.

Labels