Retrieving Ancestor (date) value from multi-level parent-child rows
Hi All,
I used the following formula to retrieve ancestor (first parent) date value of the multi-level parent-child rows for each row.
=LEFT(INDEX(JOIN(ANCESTORS(Date@row), ","), 1), 8)
The issue that I'm facing is the return value being "TEXT" despite having "DATE" column type. Since I have to use this return value in comparing other dates, suggest any other alternative to retrieve the value in DATE format
Best Answer
-
Hi @Suriya
You can use the Header value as the search value of the MATCH function.
Find the relative position of the first ANCESTORs value of the Header in the Header:Header range gotten by INDEX(,1).
In English, the formula means to find the top ANCESTORS of a given header and use the relative position to get the corresponding date value.😀
=IF(COUNT(ANCESTORS(Header@row)) = 0, Date@row, INDEX(Date:Date, MATCH(INDEX(ANCESTORS(Header@row), 1), Header:Header, 0)))
Answers
-
Hi @Suriya
You can use the Header value as the search value of the MATCH function.
Find the relative position of the first ANCESTORs value of the Header in the Header:Header range gotten by INDEX(,1).
In English, the formula means to find the top ANCESTORS of a given header and use the relative position to get the corresponding date value.😀
=IF(COUNT(ANCESTORS(Header@row)) = 0, Date@row, INDEX(Date:Date, MATCH(INDEX(ANCESTORS(Header@row), 1), Header:Header, 0)))
-
It works! Thank you @jmyzk_cloudsmart_jp
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 437 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!