r - Power BI Path Function -


i'm looking find way replicate path function power bi/dax in r. basically, recursive parent-child lookup 1 end of hierarchy (either direction work, both great edification).

i have played around hierarchical queries in sql success, wondering if there potentially better solution implement using r allow me integrate function in larger etl process.

update:

to illustrate this, have following table:

     child_id parent_id 1        1        na 2        2         1 3        3         1 4        4         3 5        5         2 6        6         4 

i looking way (in r) achieve following:

      child_id parent_id path 1        1        na       1 2        2         1     1|2 3        3         1     1|3 4        4         3   1|3|4 5        5         2   1|2|5 6        6         4 1|3|4|6 

where child/parent_id represent employee/manager id's , path represents chain of command highest level.


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -