Perform additional steps depending on a value / variable
I have a tricky task. I am building a hierarchy based on a parent/child table. Unfortunately, I do not know how many levels the hierarchy will have. And even worse, it's subject to change from time to time.
So what I would like to do is query the parent/child table as long as necessary. E.g. if I find out that in level 3 there will not be any more children, the next steps should not be performed.
I am sorry, that does not help. What I want to do is perform additional steps in the data source gathering depending on informations from that data source.
I am getting data from a source which is a list of all bosses. I then want do see their direct reports. And for them, again the direct reports. And this should be done as long as there are direct reports.
The reason why the classical hierarchy does not work is that there might be direct reports with more than 1 boss and the hierarchy does not come in columns, but in rows...