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.

Joining then Union, shift values to different columns

wonka1234
10 - Fireball

Hi,

 

I have a macro and then use a crosstab to join the results together:

 

wonka1234_0-1647353923046.png

 

wonka1234_1-1647353976870.png

 

 

I feel like my results in the 2nd row should be shifted over 3 columns.

Does anyone know how to do this?

 

6 REPLIES 6
TheOC
15 - Aurora
15 - Aurora

hey @wonka1234 
Try using the different configuration settings on the union tool:

TheOC_0-1647355360894.png



These will allow you to specify how to join the data.

Hope this helps,
TheOC


Bulien
wonka1234
10 - Fireball

this is so confusing, here are my two tables.

 

PersonDivisonRole
LouisActorLead
TomActorSupport
AlanNon-ActorSupport
SteveActorSupport
   
   
PersonDivisonRole
LouisActorLead
TomActorSupport
AlanNon-ActorLead
SteveActorSupport

 

 

Result is 

 

PersonDivisonRoleRight_PersonRight_DivisonRight_RoleResult
AlanNon-ActorLead   Data 2 Unmatched in Data 1
AlanNon-ActorSupport   Data 1 Unmatched in Data 2
LouisActorLeadLouisActorLeadMatched
SteveActorSupportSteveActorSupportMatched
TomActorSupportTomActorSupport

Matched

 

 

 

     

 

 

 

 

 

but should be:

 

PersonDivisonRoleRight_PersonRight_DivisonRight_RoleResult
   AlanNon-ActorLeadData 2 Unmatched in Data 1
AlanNon-ActorSupport   Data 1 Unmatched in Data 2
LouisActorLeadLouisActorLeadMatched
SteveActorSupportSteveActorSupportMatched
TomActorSupportTomActorSupportMatched
clmc9601
13 - Pulsar
13 - Pulsar

Hi @wonka1234,

 

Try adding a Select or a Dynamic Rename tool after your Right output anchor. Change Person, Division, and Role to be Right_Person, Right_Division, and Right_Role. By default, the Join happening inside your macro will not add the Right_ suffix to unmatched data from the right table.

 

wonka1234_0-1647353923046.png

wonka1234
10 - Fireball

@clmc9601 The select tool and renaming column works good, however what if my columes are not Person, Division and Role?

clmc9601
13 - Pulsar
13 - Pulsar

@wonka1234then use a Dynamic Rename (on the Developer tab) to "Add a Prefix/Suffix" to all fields. Add "Right_" as a Prefix and be sure to select "Dynamic and Unknown" fields. That will modify the names of every field that passes through the tool, even when they haven't shown up in the data yet.

allwynthomas24
11 - Bolide

Hey @wonka1234,

 

Please check the attached workflow and confirm whether it matches your listed requirement.

 

Thanks & Regards,

Allwyn.

Labels