Forum Discussion

alexsvi's avatar
alexsvi
Regular Visitor
5 years ago

Calculated column to find first parent

Hi,

 

Lets say I have this :

IDParentIDNameFirts parent Name
10Name1Name1
20Name2Name2
31Name3Name1
41Name4Name1
52Name5Name2
63Name6Name1
75Name7Name2

 

How do I achive the last column as a calculated column?

 

Thanks!

2 Replies

  • alexsvi , Try a new column like

    coalesce(maxx(filter(table, [ID] =earlier([parent_id])),[name]),[Name])

    • alexsvi's avatar
      alexsvi
      Regular Visitor

      I actually need to "go up" until I have a 0 in parent_id. I can have more than 5-6 layers in reality.

      I tried your code and it almost work, but some doesnt "climb" to the top parent