Hi Alteryx engineer,
I have some data like this
A |
B |
C |
1 |
2 |
3 |
TOTAL |
D |
1 |
2 |
3 |
TOTAL |
E |
F |
G |
I Want to concatenate string under C and D section and output like below, how can i implement?
A |
B |
C |
C1 |
C2 |
C3 |
TOTAL |
D |
D1 |
D2 |
D3 |
TOTAL |
E |
F |
G |
Hi @187 ,
Here is one way of doing this.
Workflow
Multi-Row formula expression
Output =
IF RegEx_Match([Data], "\d+")
THEN [Row-1:Output]
ELSE [Data]
ENDIF
Formula tool expression
Output =
IF REGEX_Match([Data], "\d+")
THEN [Output] + [Data]
ELSE [Output]
ENDIF
Output
Thanks for the reply, yes this is working for the case, just wondering if the 1 2 3 is not number , and it is string as well, what is the advice?
Hi @187 ,
It depends on the condition to distinguish the Level-2 string (1, 2, 3...) from the Level-1 string (A, B, C...).
Currently, the strings are distinguished whether it is all numbers or not (in Multi-Row formula and Formula) as below:
REGEX_Match([Data], "\d+")
If there is a different rule, you can modify the regular expression accordingly.