Alteryx Designer Desktop Discussions

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

Combining data from 2 columns with same header name into data within single column

JeeKinn
6 - Meteoroid

Hi Alteryx community,

 

Could anybody please help me with this problem? I need to combine data from 2 columns into a single column. The name of the headers for these 2 columns are the same. 

 

Combine data from 2 fields with same header name.png

 

So the reason why I am having this problem is because I am extracting this data from a system. The system makes use of template versions to record the data.  So Sample 1 to 6 could be using version 1 where there are F and L pH sample tests but the template was revised to version 2 from Sample 7 onwards and in this case, the system will generate a new column but with the same header name for the same test. The templates could be revised in the future as well. Is there any solution that could combine all the data with the same header, regardless of how many columns there are with the same name, into a single column?

 

One more thing is that my current Alteryx workflow has a dynamic rename tool following the input tool to take the first row of data as headers and since headers cannot have the same name, the tool will have a warning message stating that there were multiple fields named "pH (F)" and that it is renamed to pH (F)_2.

 

Appreciate any help that you could provide. Thank you!

 

__PRESENT

6 REPLIES 6
caltang
17 - Castor
17 - Castor

Made a long one to cover all bases as dynamically as possible.

 

image.png

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
Raj
15 - Aurora

PFA hope this help

Qiu
21 - Polaris
21 - Polaris

@JeeKinn 
I will answer your first question.
yes, Alteyx doest allow duplicated Filed Name when duplication will be forcely renamed with suffix number.

We can use that for your first question.

I tried with RegReplace to remove the Suffix number and hope you dont mind the order of fields.

1025-JeeKinn.PNG

JeeKinn
6 - Meteoroid

Thank you for the effort and the time spent! I would have to take some time to analyze the solution. 🙏

caltang
17 - Castor
17 - Castor

Elegant solution as always @Qiu !

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
Qiu
21 - Polaris
21 - Polaris

@caltang 
Thank you for the kind word. Did not get the order as input thought. 😁

I can learn much from your work.

Labels