Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Hierarchy / Iterations

BRRLL99
11 - Bolide

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:

 

ParentChild
A1X1
A1X2
A1X3
A1B
BY1
BY2
CS1
CS2
CS3
RZ1
DE1
DE3
Y1L1
Y1L2
Z1J7

 

Expected Output:

 

 

A1X1X2X3BY1Y2
BY1L1L2Y2  
CS1S2S3   
RZ1J7    
DE1E3    
Y1L1L2    
Z1J7     
7 REPLIES 7
martinding
13 - Pulsar

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).

 

martinding_0-1681164949690.png

 

martinding
13 - Pulsar

My Bad! haven't read the example properly! Let me fix it:

martinding_0-1681165989788.png

 

Qiu
21 - Polaris
21 - Polaris

@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

0411-BRRLL99.PNG

martinding
13 - Pulsar

@Qiu Neat! Thanks for sharing!

BRRLL99
11 - Bolide

yes

L1 & L2 should be Child items

BRRLL99
11 - Bolide

is there any different way apart from using this macro

because I have 1 million rows

this macro making the workflow slow

Qiu
21 - Polaris
21 - Polaris

@BRRLL99 
Macro makes the flow dynamic which suits your large data.

Maybe you can try with AMP engine?

Labels
Top Solution Authors