We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Connect Discussions

Find answers, ask questions, and share expertise about Alteryx Connect.

Macros

RamaKeerthana
5 - Atom

Hi Alteryx Community,

I’m trying to build an iterative macro that expands a manager hierarchy from an employee file. My input file looks like this:

user id | staff number | name | manager name

I want the output to include multiple levels of managers, like this:

user id | staff number | name | manager | manager1 | manager2 | manager3 | manager4

Each manager column should represent the next level up in the hierarchy. For example, manager1 is the manager of manager, manager2 is the manager of manager1, and so on.

Could someone guide me on how to structure the iterative macro to achieve this? Any tips on handling potential loops or missing manager data , how to handle the dynamic renaming of column in the macro would be appreciated!

Thanks in advance!

2 REPLIES 2
KGT
13 - Pulsar

This has been dealt with quite a few times, and so take a look at the below links to see how close you get. There are a couple more posts floating around, but no point re-inventing the wheel. You can always open up one of these solutions and customise it.

 

https://community.alteryx.com/t5/Community-Gallery/Hierarchy-Generation-Macro/ta-p/880709

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

 

RamaKeerthana
5 - Atom

Thank you will try this approach !!!