Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Oct 15, 2018 03:18 AM
Hi Can anyone help please? I am trying to find a way to count linked records in the same table I think someone may have found a work around but am going around in circles trying to find anything I can understand.
Thanks, Maria
Oct 15, 2018 03:39 AM
You can do this:
ARRAYJOIN(LR)
LEN(String)
LEN(SUBSTITUTE(String,',' , ''))
Length - {No commas} + 1
.Oh, I have wrapped the last step into a IF()
to check if there are linked records so we don’t get 1
when they are not: IF({Linked Records}, Length - {No commas} + 1, 0)
.
Of course you can put all together :grinning_face_with_sweat:
Oct 15, 2018 04:04 AM
Elias
Thank you so much for your amazing quick reply and solution! I will give it a try.
If I had a few linked record fields and I wanted totals of all under one field - would this work? and if so would I need to create a set of formual fields for each linked record field or could I combine?
Oct 15, 2018 05:21 AM
What do you mean?
You could combine multiple formulas for all Linked Records fields in one Formula field and sum all, but you will get a way complicated formula. What are you trying to achieve? What is your base structure?
Oct 15, 2018 10:29 AM
Hi Elias
Your formula is brilliant - I have no idea how you did but thank you so much!!!
I am attaching a screenshot so you can see what I mean by multiple linked record fields.
I have duplicated your formula so now have user stories and tasks
And created this formula - {user stories+} + {tasks+} - to get ‘total linked records’
All great and happy to copy and paste for my other linked record fields but wondering if you knew a quicker way or if your formula would work somehow?
Oct 15, 2018 10:43 AM
I explained it! Anyway, I stole (learn) this from someone else in the forum.
Oct 15, 2018 10:48 AM
Got ok by copying and pasting but praising you for being able to do it! You don’t know how long I have been trying a way of doing it. Big thank you again
Oct 18, 2018 12:00 PM
No need for fancy formulas! Insert a new field and select “Count” and the other field that you would like to count. Done. The only issue that I’ve found so far is you cannot count unique linked records across an entire table (down a column). It just adds up each row even if it is counting a linked record twice.
Oct 18, 2018 12:50 PM
Thanks Ian I will give it a try.
Oct 18, 2018 01:36 PM
It does not work with linked records from the same table.
I don’t understand your issue explanation.