Skip to main content

Count occurence of each unique in a Rollup

  • June 23, 2024
  • 2 replies
  • 21 views

Forum|alt.badge.img+4

Hi,

Let's say I have a People table with Name A, Name B, Name C.

Another Table "Sports", which links Name A with Football, Name A with Football (again), Name A with Basketball, Name B with Basketball, Name B with Basketball, etc.

In the People table I want to create a (rollup?) field that returns e.g. for Name A: "Football (2), Basketball (1)" as a string.

Haven't been able to figure it out playing with COUNT, ARRAY, etc in Rollup field and searching this forum. Any ideas?

2 replies

kuovonne
Forum|alt.badge.img+29
  • Brainy
  • June 23, 2024

You cannot do this with only a single rollup field with the current Airtable features. 

If there are only a few possible sports, you could have a conditional rollup field for each sport, then combine the info for all the sports using another formula field. 


Alexey_Gusev
Forum|alt.badge.img+25

If you have defined list of sports, you can hardcode them in formula
IF(Find('SPORT', {Rollup}),
  'SPORT: '&(LEN({Rollup})-LEN(SUBSTITUTE({Rollup}, 'SPORT','')))/LEN('SPORT')
) & 
IF(Find....


repeating it X times with the name of sport instead of SPORT
{Rollup} is rollup field, with all linked sports.