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.

How to exactly filter data after Join tool

TeresaZhang7517
7 - Meteor

Hello, I have a problem for extract exactly data now.

For example, I use join tool on table A and table B based on type field, and amount difference is within 0.1. I want extract the data 1 on 1 by same field. If there are multiple matched result, need to extract abs(amount difference) data is closet to 0. And each id(id1 and id2) can only be used once.

table A: 

id1amount1type
A1199.57OTC
A2199.58OTC
A3199.57OTC

 

table B:

id2amount2type
B1199.58OTC
B2199.57OTC
B3199.56OTC

 

when I use Join tool by type field, result as below.

id1id2amount1amount2difftype
A1B2199.57199.570OTC
A1B3199.57199.560.01OTC
A1B1199.57199.580.01OTC
A2B1199.58199.580OTC
A2B2199.58199.570.01OTC
A2B3199.58199.560.02OTC
A3B2199.57199.570OTC
A3B3199.57199.560.01OTC
A3B1199.57199.580.01OTC

 

Now, I need filter join result and want to get the final result as below. But I don't know how to implement it except using iterative macro.

id1id2amount1amount2difftype
A1B2199.57199.570OTC
A2B1199.58199.580OTC
A3B3199.57199.560.01OTC

 

How can I output the correct result?

3 REPLIES 3
ArnaldoSandoval
12 - Quasar

Hi @TeresaZhang7517 

 

I did not get your result on the third row, A3-B3 with a diff of 0.01 because A3 and B2 has a difference of zero.

 

hth

Arnaldo

 

TeresaZhang7517
7 - Meteor

Hi @ArnaldoSandoval ,

Thanks very much for your fast reply.

Because B2 data is matched with A1 with a diff of 0. B2 and A1 should not be matched by other data. This is my pain point.

flying008
14 - Magnetar

Hi, @TeresaZhang7517 

 

Any idea as yourself ? This is a very nice case.

Labels