Summarizing number of each type of unique item

Goal: take Rollup results, and summarize the unique values with a count of each unique value. For example, instead of showing [10, 10, 10, 2, 2, 1, 1, 1, 1, 0.5], I want to show [3 x 10, 2 x 2, 4 x 1, 0.5]. Or, if needed, I can show [3 x 10, 2 x 2, 4 x 1, 1 x 0.5]. Or, similarly, instead of showing [carrot, carrot, carrot, potato, potato, onion], I want to show [3 x carrot, 2 x potato, onion]. The ARRAYJOIN seems to be working as designed so far, but I’m hoping to summarize the results in a way that is a bit more user-friendly.

I suspect there is some way of using the ARRAYUNIQUE function to help with this, but I haven’t found a solution.

PS: this is my first post here, so feel free to let me know if I’m doing anything wrong and I’ll work to correct it.
[edits: spelling correction; new example and explanation]

Welcome to the community, @Jesse_Groenewold! :smiley: The basic options that you’ve found so far will, unfortunately, only get you so far. Collecting the data in the manner that you describe is beyond the scope of Airtable’s formula system, largely because it currently lacks the means of iterating through arbitrary collections and temporarily storing data in variables before generating the final output.

It’s totally doable using scripting, though. The script could either be run manually via a Scripting app, or as part of an automation, though the latter option will require your base to be in a Pro-plan workspace or higher.

Are you looking to write such a script yourself, or would you prefer to hire someone to take care of that for you? If it’s the latter, feel free to reach out and we can talk about the options.

Thank you, @Justin_Barrett! At this stage I’ll do some research: look at some examples of scripting use and see whether it makes sense for me to attempt it myself. Looking at some script-related discussions in the community, I see some (possibly) related approaches that I hadn’t noticed when I asked this question, so perhaps I can use those (here’s one example).

1 Like

This topic was solved and automatically closed 15 days after the last reply. New replies are no longer allowed.