Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Join messed up because more than 1 record for the field i am joining

maygross
8 - Asteroid

Hi,

 

Basically I'm joining two tables, one of them has subscriber numbers and payment amount and the other has subscriber numbers and model type. In the second table, one subscriber could have more than one model type. When I join, the payment amount is now duplicated because one subscriber has two model types so the payment amount section is incorrect when summarized. I dont care which model type is selected, but how do i make it so only one is selected and joined?

maygross_0-1686758423560.png

 

9 REPLIES 9
binuacs
21 - Polaris

@maygross If you don't consider the model number you can use the summarise tool or sample to achieve the result

 

binuacs_0-1686758911374.png

 

Kenda
16 - Nebula
16 - Nebula

@maygross 

 

You could also use a Sample tool on your table 2 and keep only the first 1 row and group by sub # prior to joining to the other table. This will result in just one record per sub # from that dataset. 

maygross
8 - Asteroid

the whole point is that i need all three columns though... i cant exclude the model type

Kenda
16 - Nebula
16 - Nebula

@maygross You will still have model type. You will just keep the first record for each Sub #. Try it out and let us know if that's what you're looking for.

Kenda_0-1686763468224.png

 

nagakavyasri
12 - Quasar

Screenshot 2023-06-14 134144.png

maygross
8 - Asteroid

How do I do the sample tool when my data is inDB?

Kenda
16 - Nebula
16 - Nebula

@maygross 

 

A similar result can be achieved using the Summarize In-DB tool, grouping by Sub # and selecting First for model type.

hlee36
8 - Asteroid

"Unique" tool will do the job. You can still keep your workflow and just add the "Unique" tool (Or you can put "Unique" tool to the second dataset before joining). Make the "sub#" field as unique, then it will remove the duplicates. Keep in mind that the model type will be the first model type in the original data in case of multiple model types. 

 

hlee36_2-1686774689316.png

 

 

hlee36_0-1686774646003.png

 

maygross
8 - Asteroid

unfortunately i am using in DB so the unique tool wont work for me here... otherwise i would have used that. do you have a similar suggestion for in db?

Labels
Top Solution Authors