Trying to count a look up field in a table


#1

Im part of a non-profit that puts on events. We are most known for our music shows. I’ve had a really great time with Airtable so far and feel close to finishing a event planning base for the org.

I am currently trying to build out a Table that can track the diversity of genres reflected in the shows that we are scheduling. In this table I have been able to create a field that has a list of shows that feature a specific genre. But the problem is that I achieved that through creating a look up, which doesn’t seem to allow for counting. When I create another field for counting it only allows me to count the performers field which is a look up. I’ve been messing with this for a while, And I can quite figure a way to get this field to work the way I want. Let me know if anything is unclear, I hope there is a work around.

*Excuse the stand in event names.


#2

Hi Andrew,

The lookup data comes from another table. Is it possible to use the count option in that table, and than use lookup in the current table for that count result?

Regards,
André


#3

Brilliant, Worked like a charm!


#4

Your {Shows Featuring} lookup field — is that a lookup that follows the {Potential Performers} link? What field is it looking up?

If the need is simply to count the number of values in {Shows Featuring}, try this formula:

IF(
    {Shows Featuring},
    LEN(
        ARRAYJOIN(
            {Shows Featuring}
            )&','
        )-LEN(
            SUBSTITUTE(
                ARRAYJOIN(
                    {Shows Featuring}
                    )&',',
                    ',',
                    ''
                )
            )
    )