Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Adding a column from a different input file

Floris77
6 - Meteoroid

Hi,

I was wondering how I can add a column from a different input file to the main file. Problem I'm facing; the second input field does not contain ALL combining fiields as the main file.

 

Example.

 

File 1

 

Name     City

Scott       Amsterdam

Eric         New York

John       London

 

File 2

Name     Phone

Scott      +31123456789

 

So, how can I add the column 'Phone' in file 1, and showing no phone number for the rows not mentioned in File 2 (as shown below)

 

Name     City               Phone

Scott       Amsterdam   +31123456789

Eric         New York

John       London

 

I tried it with the Join and Union function, but that will only show the name with the phone number, not the ones without.

 

Thanks a lot,

Floris

 

4 REPLIES 4
jdunkerley79
ACE Emeritus
ACE Emeritus

A Join (on Name) followed by a Union (taking the L(eft) and J(oin) outputs) should do what you need.

 

2016-06-13_14-06-40.jpg

 

Only issue I could think of is if you have trailing spaces on one of the inputs such that the Names arent equal. In which case you will need to use a formula tool to tidy a little first.

 

Sample workflow attached.

Floris77
6 - Meteoroid

thanks a lot!

 

bellhlks
5 - Atom

I have a similar question to the above, but takes it one step further.  I have two files that I am trying to compare, but need to reference two columns in one file to multiple columns in another file.

 

File 1 includes a list of companies and the year we did work with them. File 2 is the “key” of what priority tier they were in in the respective year.  I would like to pull in the relevant Priority Tier from the relevant year.

 

I was able to build the Alteryx flow shown above, but cant quite figure out how to do this one.

 

Here is a made-up example:

 

In File 1

 

Date                       Company                             Priority tier        

2015                       ABC Company                 

2017                       XYZ Company                  

2014                       My Company                    

 

 

In File 2

 

                                         2017       2016       2015       2014

ABC Company                  3              2              1              2

My Company                     2              1              2              3

XYZ Company                   3              2              NA           2

 

 

Requested outcome

 

Date                       Company                         Priority tier        

2015                       ABC Company                  1

2017                       XYZ Company                  3

2014                       My Company                    3

egtuna
5 - Atom

I had a similar issue where I had to compare a field from "yesterday's results" to "today's results" to see if any values are/aren't present today, and this method worked perfectly (just had to add another Conditional formula after the union to compare my joined fields between "Today" and "Yesterday" to set to 1 or 0. Thanks for an easy and perfect solution.

Labels