This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
After removing the known level from your example data, the workflow adds the Level field with a value of 1 when the "ReportsTo ID" is 0, and then calls the macro.
The macro will take the iterative input, filter if Level is Null, joining those two streams together by "Employee ID" from the Left and "ReportsTo ID" from the Right, formula to add 1 to the known level, union all the data back together, and output all to the loop.
Using the Interface Designer view, I set the iterations to to stop at 20, if you had more than 20 levels, you would need to increase this.