Count IF solution

Hi everyone!

This is my first app with Glide and would love some help with a column formula:

Context: I am building a reservations internal app. Users will need to add their phone numbers, which has a relation with the users table. I also have a “CANCELLATIONS” in which we submit if a user didn’t attend.

Problem: I need a column in the users table that counts how many times this specific user have cancelled.

Question: How can I use a similar COUNT IF option to count the number of times a user has cancelled based on how many rows the phone number appears in the “CANCELLATIONS” table?

Thank you in advance! :slightly_smiling_face:

Hi, Mauricio_Gonzalez!
I think you can create multiply relation from phone number in User table to phone number in cancelation table and do Rollup count thru this relation

1 Like

As mentioned, a relation plus rollup will get you what you want.

However, building relations based on user supplied phone numbers is going to be a very fragile solution. If a user enters a space or a leading zero, for example, it will break.

Assuming that your Users will be signed in to your App, you are much better adding the Users email address or UserID (RowID) from their User Profile to your Cancellations table, and use that to create the relation. Either of those can be captured automatically when the cancellation is submitted, so you won’t have to rely on Users always entering the same phone number.


Thank you @Darren_Murphy and for the prompt responses!

Darren - yes, as for the relation, I was also thinking of utilizing the user ID instead, but my concern is that I might not ask everyone to sign in. This is the main reason why I was hesitant to do it this way. I think I will further think about the relation logic behind this. Thank you again!

Hi Mauricio :wave:

Asking users to sign in isn’t just a UX “annoyance”. Anytime you want to personalize your app, personalization is associated to a user via a user identifier, which in Glide is an email address (and by extension a Row ID in the Users table).

So you could implement cancelations without a user sign-in and instead us phone numbers as the identifier, but I agree with Darren, building relations on user submissions is fragile. If a reservation isn’t associated to a user via their email address or Row ID, then I would say you don’t have the concept of reservations or cancelations in your app.


Thanks @nathanaelb - will adjust to user IDs. Thanks all!

1 Like

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