IF statement with child/parent logic
The Problem:
I need to have autonumber as a Unique Identifier for each row. When that row changes due to changing business requirements, I want to create a child row but it should not have a different Unique ID from the parent. It could either have the same Unique ID or no Unique ID, but if I have autonumber turned on then Smartsheet automatically numbers every single row separately.
Attempted Solution:
1. Use autonumber, which creates a Unique ID for every row (even child rows)
2. Create a calculation column to reference the autonumber column. I need help writing the formula for the logic "if row is a child row, then calculation field equals the Unique ID of the parent row. If not, then calculation field equals the Unique ID."
In the attached screenshot, it would be something like "IF((row = child), [Campaign ID]5=Parent([Campaign identifier]),[Campaign ID]5=[Campaign identifier]5)"
Any tips?
Comments
-
Do your children rows have any children of their own?
If not, that helper column can be: IF(COUNT(CHILDREN())>0,[campaign identifier]@row,PARENT()
You're telling it that if it's a parent row, to give the unique ID of that row. If it's a child, to give the parent value (which is its unique ID).
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 495 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!