Giving a Parent Row a level score
![RobS](https://us.v-cdn.net/6031209/uploads/defaultavatar/nWRMFRX6I99I6.jpg)
Hi
Is it possible to give a parent row a score based on its hierarchy in the row grouping? ie The top level of grouping being level 1, next level of grouping level 2, but only where the row is a parent?
I am currently using =COUNT(ANCESTORS()) but this gives a task a score even if it doesnt have a child.
It would be great to return a level like in the image below.
I have seen it done before but its been a while and cant remember. If anyone could help, it would be appreciated.
Thanks.
Best Answer
-
Hi @RobS,
This formula should do what you're after:
=IF(COUNT(CHILDREN([Task Name]@row)) > 0, COUNT(ANCESTORS()) + 1)
Using your example data:
Hope this helps, but any problems/queries then just post! 🙂
Answers
-
Hi @RobS,
You could use an IF statement where you use "COUNT(CHILDREN) > 0" as the logical expression to see if it has children and where the answer is true use your logic, where false you can use "" to leave the row empty.
Hope this helps!
John
-
Hi @RobS,
This formula should do what you're after:
=IF(COUNT(CHILDREN([Task Name]@row)) > 0, COUNT(ANCESTORS()) + 1)
Using your example data:
Hope this helps, but any problems/queries then just post! 🙂
-
Perfect, thank you Nick.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 62.1K Get Help
- 348 Global Discussions
- 199 Industry Talk
- 427 Announcements
- 4.4K Ideas & Feature Requests
- 133 Brandfolder
- 127 Just for fun
- 127 Community Job Board
- 455 Show & Tell
- 28 Member Spotlight
- 1 SmartStories
- 282 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!