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.
SOLVED

Concatenate columns dynamically

mihaicom20
8 - Asteroid

Hello,

 

I am wondering if there is a smart way or dynamic way to concatenate multiple columns, based on specific condition: all columns after a specific one until another specific column.
Formula Tool can't do the trick if the number column is varying, so the formula needs to be modified each time.

As an example I would like to concatenate all Columns after "Short text" up to "Matl Group", that may vary from input to input.The short text was split from a CVS file and for some rows the "TAB" delimiter was found on the data and that is why there are many columns.  Sometimes I can have 5 Field and sometimes 20 Field.  

As a small help: I can move the Text Column at the end of the export and all the "Field*" to be at the end generated.

mihaicom20_1-1643906520299.png

 

 


Thanks in advance.

8 REPLIES 8
atcodedog05
22 - Nova
22 - Nova

Hi @mihaicom20 

Can you provide some sample input and expected output in a file. It will help us get a better understanding of the usecase.

We will be happy to help : )

mihaicom20
8 - Asteroid

CVS is the raw data and sample what i wan't to achieve. The lines with yellow, are the ones that generate me multiple columns. 

mihaicom20
8 - Asteroid

BUMP

mihaicom20
8 - Asteroid

@atcodedog05 any ideas how can I achieve this? 

Thank you!

atcodedog05
22 - Nova
22 - Nova

Hi @mihaicom20 

 

Sorry for the delay i must have missed it somehow.

 

You merge columns dynamically like this.

 

atcodedog05_0-1644224478898.png

 

Now you need to tell me how are they split. Column order in expected output is not the same as input column order. Please provide exact mapping to split.

 

Hope this helps : )

 

mihaicom20
8 - Asteroid

@atcodedog05 please find attached the exact same exports: one in CSV format, one in XLSX(the format that I want). I want to extract the data in CSV format for a faster reading of the files. The CSV file I split it with "\t" delimiter and the problem appear for first and third line when I have the "|" sign on description.

Thank you again for help!

mihaicom20
8 - Asteroid

@atcodedog05 I found a solution combined with yours that helped me to generate the output that I want. Thank you so much for your help!

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @mihaicom20 

Cheers and have a nice day!

Labels