# Weekly Challenge

Solve the challenge, share your solution and summit the ranks of our Community!
###### IDEAS WANTED

We're actively looking for ideas on how to improve Weekly Challenges and would love to hear what you think!

Submit Feedback
We've recently made an accessibility improvement to the community and therefore posts without any content are no longer allowed. Please use the spoiler feature or add a short message in the message body in order to submit your weekly challenge.

## Challenge #12: Creating an HR Hierarchy

Highlighted
Alteryx Certified Partner

My solution was pretty much the same as the one provided.

Highlighted
14 - Magnetar

Well I sure wish I hadn't completely forgotten about watching the Live Training on Iterative macros this morning... that was painful.

My solution attached.

Highlighted
Alteryx Certified Partner

Similar solution within the iterative macro. I've actually recently had to build this kind of HR Hierarchy for a client and I've ended up createing this kind of iterative Macro within a Batch Macro so the user can select a list of employees to see their entire HR Tree for. Fun project!

In response to @siddhartha_s comment about creating a visualisation of this hierarchy. What you need to do is think about the visualisation as an x_y coordinate plot and find out where each person would be plotted. You can do this simply by finding the median of the hierarchy level, to position them along the y axis. Their position along the x axis can be determined by their level.

Spoiler

Phil

Highlighted
Alteryx Certified Partner

Similar solution within the iterative macro. I've actually recently had to build this kind of HR Hierarchy for a client and I've ended up creating this kind of iterative Macro within a Batch Macro so the user can select a list of employees to see their entire HR Tree for. Fun project!

In response to @siddhartha_s comment about creating a visualisation of this hierarchy. What you need to do is think about the visualisation as an x_y coordinate plot and find out where each person would be plotted. You can do this simply by finding the median of the hierarchy level, to position them along the y axis. Their position along the x axis can be determined by their level.

Spoiler

Phil

Highlighted
8 - Asteroid

Went through the recording of the live training on iteration macros before I could do this challenge as I have not worked with iterative macros yet.  After much trial and error, my macro is pretty much the same as the solution provided.  I did, however, add a section to my workflow that sorts the employees by their hierarchy (lowest to highest).  These macro challenges are quite the brain-teaser :)

Spoiler
Alteryx Community Team

@DE0413, I am VERY happy to hear that the live training kicked off the journey to developing your first iterative macro.  Your first one looks great!  Being able to build macros in Alteryx is a game-changer!

Highlighted
Alteryx Certified Partner

Wow, I really struggled with this...I had to look at the solution to figure out where I was going wrong...

Spoiler
Highlighted
Alteryx Certified Partner

Solution attached. Got the following error trying to attach a .yxzp file even though I confirmed it opened and unpacked successfully. Therefore, just attaching the .yxmc file.

"The contents of the attachment doesn't match its file type."

Ken

Highlighted
Alteryx Certified Partner

Well that wasn't at all quick and required a peek at the solution.  But I got there in the end.

Spoiler
Highlighted
Alteryx Certified Partner

Solution attached.  Had to brush up on iterative macros for this one