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
- 10.8K Get Help
- 65 Global Discussions
- 69 Industry Talk
- 385 Announcements
- 3.5K Ideas & Feature Requests
- 55 Brandfolder
- 125 Just for fun
- 50 Community Job Board
- 464 Show & Tell
- 40 Member Spotlight
- 44 Power Your Process
- 28 Sponsor X
- 234 Events
- 7.3K Forum Archives
Check out the Formula Handbook template!