Alteryx Designer Desktop Discussions

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

Conditional Join

anm252
7 - Meteor

Hi guys—I’m trying to do a conditional join on Table A to 1 of 2 columns of Table B based on the value in Table A. Table A column has the following values:

 

Client ID

534

541

542

548

1305

549

578

579

 

Table B has the following 2 columns I want to possibly join on:

 

Client ID         Profile ID

534                 541

534                 542

548                 1305

548                 549

548                 578

548                 579

 

What I’m trying to do is this: If Table A Client ID = 534 or 548 then Join Table A Client ID on Table B Client ID else Join Table A Client ID on Table B Profile ID. Is this possible to do? Any help is greatly appreciated. Thanks.

3 REPLIES 3
Ben_H
11 - Bolide

Hi @anm252,

 

All joins are conditional really, in this case you can just do 2 joins one after the other.

 

Ben_H_0-1646064996483.png

For the first join, join on Client ID - Client ID (Assuming you don't want a cross join, and just the first record to match make unique first).

Then of the records that don't match (left output anchor) join on Client ID - Profile ID then union the two streams.

 

Regards,

 

Ben

 

 

Qiu
21 - Polaris
21 - Polaris

@anm252 
What will be your output looking like? 

anm252
7 - Meteor

Hi Ben--sorry for the slow response. This ended up working with a few additional conditions. Thankyou very much.

Labels