Alteryx Designer Desktop Discussions

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

Hierarchy data with Iterative Macro

Inactive User
Not applicable

Hello Everyone,

 

I'm new to Alteryx and I needed help in breaking hierarchy data into multiple levels. I have gone through several posts here in the community but none of them helped me solve the below problem.

 

The data looks like:

 

NameManager
JohnChris
ChrisBrad
RobertMaggie
BradJason

 

Expected Output:

 

NameManager1Manager2Manager3
JohnChrisBradJason
ChrisBradJason 
RobertMaggie  
BradJason  

 

I appreciate your help.

 

Thank you,

 

3 REPLIES 3
Elias_Nordlinder
11 - Bolide

Hello @Inactive User ,

 

I have created an iterative macro as well as a workflow for your question.

I would really recommend looking at this weekly challenge.
That is a great challenge for working with iterative macros and similar to your question.

https://community.alteryx.com/t5/Weekly-Challenge/Challenge-12-Creating-an-HR-Hierarchy/m-p/800445#M65281

 

It solves this question but if you have more hierarchies I think the workflow can be changed to be more effective.

The Macro however is dynamic and works for however many hierarchies you will have:

 

Macro.

Elias_Nordlinder_3-1628921115022.png

 


Very similar to the weekly challenge, with using Engine.Iteration Number to get

which place the people are in the hierarchy.

If they are in the first hierarchy output the result, if not loop it back to the macro,

then check again if they are in that "First position in the hierarchy".

 

The "Engine.IterationNumber" will increase with 1 for each iteration which

therefor can be used to specify where in the hierarchy.

 

 

Workflow:

I make use of the Hierarchy-number to put the people in the right

position depending on their hierarchy.

 

I think this can be incorporated in the macro as well and making it dynamic.

But at the moment this is the best I came up with.

 

Elias_Nordlinder_2-1628921273560.png

 

 

Elias_Nordlinder_1-1628921261703.png

 

 



Let me know what you think! 🙂

//Regards
Elias 

 

atcodedog05
22 - Nova
22 - Nova

Hi @Inactive User 

 

You might be surprised to know that there was a weekly challenge based on the same usecase 🙂

 

https://community.alteryx.com/t5/Weekly-Challenge/Challenge-12-Creating-an-HR-Hierarchy/td-p/36740/page/2

 

eProData
5 - Atom

Hello Elias,

 

I'm kindly asking if there is a way that you share the macro file that contains the Formula Tool Hierarchy you're referring to in your first screenshot.

Labels