Alteryx Designer Desktop Discussions

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

How can I concatenate every even numbered column with the previous column?

Ashman2304
6 - Meteoroid

Hi all,

 

Hope someone can help with my question! I have a data set that currently looks something like this:

 

2000-01-01F22000-01-02F32000-01-03F5
Name 1Surname 1Name 4Surname 4Name 7Surname 7
Name 2Surname 2Name 5Surname 5Name 8Surname 8
Name 3Surname 3Name 6Surname 6Name 9Surname 9

 

And I am aiming to concatenate Name and Surname into the dated columns, as below:

 

2000-01-012000-01-022000-01-03
[Name 1] + " " + [Surname 1][Name 4] + " " + [Surname 4][Name 7] + " " + [Surname 7]
[Name 2] + " " + [Surname 2][Name 5] + " " + [Surname 5][Name 8] + " " + [Surname 8]
[Name 3] + " " + [Surname 3][Name 6] + " " + [Surname 6][Name 9] + " " + [Surname 9]

 

Does anyone know how I could do this? Unfortunately, the dates change with each file so I can't manually concatenate based on field name. I was wondering if I could use a method that looks for all even numbered columns and concatenates to the previous column?

 

Any help would be great!

5 REPLIES 5
ShankerV
17 - Castor

 

.

 

FinnCharlton
13 - Pulsar

Hi @Ashman2304 , here is a way you can do it:

FinnCharlton_0-1674640257129.png

 

ShankerV
17 - Castor

Kindly ignore, as I missed to see the heading will change dynamically

 

 

 

OllieClarke
15 - Aurora
15 - Aurora

Hi @Ashman2304 here's a way to do it:

OllieClarke_0-1674640936109.png

 

The multi-row looks for the hyphen in the date, so if your other column names have a hyphen then you could be more precise with the following formula (still grouped by recordID)

IF Regex_MAtch([Name],'\d{4}-\d{2}-\d{2}') THEN [Name] ELSE [row-1:name]
ENDIF

This uses RegEx to look for the date structure ####-##-##

 

Hope that helps,

 

Ollie

Ashman2304
6 - Meteoroid

 


@FinnCharlton wrote:

Hi @Ashman2304 , here is a way you can do it:

FinnCharlton_0-1674640257129.png

 



Thank you mate, looks so easy when you do it like this! 

Labels