Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

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

Combine string records

BautistaC888
8 - Asteroid

Hello:

I need to combine records if they contain alphabets and are in sequential rows.

I attach an example.

Thank you.

3 REPLIES 3
dougperez
12 - Quasar

This should help you with that

jdunkerley79
ACE Emeritus
ACE Emeritus

If I am understanding your request correctly I would do the following:

 

- Use a multi row formula tool to create a group ID

- Use a summarise tool to concatenate the string together.

 

For the multi row formula I would do something like:

[Row-1:Group] + IIF(Regex_Match([1], "^[A-Z ]*$"),0,1)

 

This will add 1 if the string contains anything which isn't a letter or space. The regex can be tuned to match your exact needs

 

Example workflow attached

Maskell_Rascal
13 - Pulsar

Hi @BautistaC888 

 

Here is a non-RegEx solution for you. You can leverage the ToNumber() function to identify alpha/numeric rows vs strictly numeric rows, since alpha/numeric rows cannot be converted they will return a zero. 

 

IF ToNumber([1])=0 AND ToNumber([Row+1:1])=0 
THEN [1]+" "+[Row+1:1] 
ELSEIF ToNumber([1])=0 AND ToNumber([Row-1:1])=0 
THEN Null() 
ELSE [1] 
ENDIF 

 

I also added an ELSEIF to null out the sequential value identified so we can then use a Filter tool to get the final output. 

Maskell_Rascal_0-1631283627892.png

 

Workflow attached for you to try out. 

 

Cheers!

Phil

 

Labels