Hello:
I need to combine records if they contain alphabets and are in sequential rows.
I attach an example.
Thank you.
Solved! Go to Solution.
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
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.
Workflow attached for you to try out.
Cheers!
Phil