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 22, 2018 05:47 PM
Hi folks. Lookup, rollup, and count fields now support looking up, rolling up, and counting from a linked record field that has been linked to its own table. Hopefully this will make things easier for you, @Maria! Going to put an auto-closing timer on this topic.
Sep 23, 2024 06:18 AM - edited Sep 23, 2024 06:19 AM
I've actually gone ahead and built the full formula, for anyone who's still adventurous enough 😛
The following formula will return the number of Linked records in a Linked record field called "LinkedRecordsField":
IF(LinkedRecordsField,IF(LEN(SUBSTITUTE(ARRAYJOIN(LinkedRecordsField)
,',',''))=LEN(ARRAYJOIN(LinkedRecordsField)),1,(LEN(ARRAYJOIN(LinkedRecordsField))-LEN(SUBSTITUTE(ARRAYJOIN(LinkedRecordsField),',','')))+1),0)
The first IF condition checks if the field is empty and returns '0' if indeed the field is empty, otherwise we go ahead to the second IF condition, which checks if there's only 1 record within the field, by comparing between the length of characters within the ARRAYJOIN() formula and the the length of characters within the ARRAYJOIN() formula while omitting any commas. Since the presence of only 1 record would not have any commas, the formula would return 1 in this case. Otherwise, the formula subtracts the Length of ARRAYJOIN() by the kength of ARRAYJOIN() while omitting commas, and returns the result + 1, which is the exact number of linked records in the field 🙂
Now THAT WAS FUN! Good luck everyone 😄