Hi
I am trying to implement an iterative macro to build a nested hierarchy from a list of entries.
For example, starting from an input
Input:
Parent | Child |
A1 | X1 |
A1 | X2 |
A1 | X3 |
A1 | B |
B | Y1 |
B | Y2 |
C | S1 |
C | S2 |
C | S3 |
R | Z1 |
D | E1 |
D | E3 |
Y1 | L1 |
Y1 | L2 |
Z1 | J7 |
Expected Output:
A1 | X1 | X2 | X3 | B | Y1 | Y2 |
B | Y1 | L1 | L2 | Y2 | ||
C | S1 | S2 | S3 | |||
R | Z1 | J7 | ||||
D | E1 | E3 | ||||
Y1 | L1 | L2 | ||||
Z1 | J7 |
Hi @BRRLL99,
Not sure what your actual data looks like, but if your example describes what you need, then here's one approach without using macro (and it is also dynamic).
@BRRLL99
I think L1 and L2 shall be the children also?
I use this macro.
https://community.alteryx.com/t5/Community-Gallery/Hierarchy-Generation-Macro/ta-p/880709
@Qiu Neat! Thanks for sharing!
yes
L1 & L2 should be Child items
is there any different way apart from using this macro
because I have 1 million rows
this macro making the workflow slow
@BRRLL99
Macro makes the flow dynamic which suits your large data.
Maybe you can try with AMP engine?
User | Count |
---|---|
106 | |
82 | |
70 | |
54 | |
40 |