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:
Name | Manager |
John | Chris |
Chris | Brad |
Robert | Maggie |
Brad | Jason |
Expected Output:
Name | Manager1 | Manager2 | Manager3 |
John | Chris | Brad | Jason |
Chris | Brad | Jason | |
Robert | Maggie | ||
Brad | Jason |
I appreciate your help.
Thank you,
Solved! Go to Solution.
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.
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.
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.
Let me know what you think! 🙂
//Regards
Elias
Hi @Inactive User
You might be surprised to know that there was a weekly challenge based on the same usecase 🙂
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.