Alteryx Designer Desktop Discussions

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

Identify where joined column comes from

wonka1234
10 - Fireball

Hi all,

 

Is there a way to rename columns or add a prefix of the filename to the column?

I am doing a join and would like a better way to identify where the column comes from other then "left" or right".

 

wonka1234_0-1647010355100.png

ie I'd like to rename,   [File1]_Person  or [File2]_Person

 

 

Any help would be appreciated.

14 REPLIES 14
JosephSerpis
17 - Castor
17 - Castor

Hi @wonka1234 you can via option in the join configuration or you enter the value you want in the Rename column. However you wouldnt be able to dynamically add the filename within the Join tool. You could however build out some logic using the dynamic rename tool though.

Pre-fix.JPG

wonka1234
10 - Fireball

How can I make this dynamic to pickup the file name used?

wonka1234_1-1647010740917.png

 

 

AkimasaKajitani
17 - Castor
17 - Castor

Hi @wonka1234 

 

You can also use the Dynamic Rename tool.

Using this tool, you can add Prefix/Suffix to the field names.

 

AkimasaKajitani_0-1647010727014.png

 

If you put into Dynamic Rename tool before join tool, it will work well. 

 

AkimasaKajitani_1-1647010816021.png

 

 

Luke_C
17 - Castor

Hi @wonka1234 

 

Like @AkimasaKajitani said, dynamic rename will be your friend. 

 

If you read in the file name as a field, you can dynamically fetch it and use it like below. The standard functionality makes you hardcode a prefix, so this will be dynamic if your files change.

 

  1. Use field info tool to get field names
  2. Isolate file name and append to the field info data
  3. Create a new field name
  4. Use dynamic rename to update fields

Luke_C_0-1647011068230.png

 

AkimasaKajitani
17 - Castor
17 - Castor

I made other solution, but similar to @Luke_C 's solution.

We can get the file path from "Source" field by Field Info tool.

 

AkimasaKajitani_2-1647011721646.png

 

I use this information. So my solution is as follows.

AkimasaKajitani_1-1647011652293.png

 

 

 

 

JosephSerpis
17 - Castor
17 - Castor

Hi @wonka1234 I came up with an approach which will rename all the fields after the join with the file name. Let me know what you think?

 

File_Name_11032022.JPG

wonka1234
10 - Fireball

@Luke_C  Hi Luke, how did you get file name in your "input" file though? I do not have this.

Luke_C
17 - Castor

Hi @wonka1234 

What kind of input are you using? Most files will allow this:

Luke_C_0-1647013934298.png

 

 

wonka1234
10 - Fireball

cant open! wrong version :(

Labels