Display the Count of items matched in a 'Relation' list

Is there a way to get the number of items matched via a Relation (list) to display in a Text component?

(We can already see the items matched in the Data sheet, so I figured the info is there just need to get to it or make it available)?

My use case: I want to display the number of reviews received for a particular item (trying to avoid using formulas in the sheet as much as possible as it is far too laggy)

1 Like

Very soon.

2 Likes

This is live now, try it!

2 Likes

Nice one! :slight_smile: - exactly what I needed in order to show the number of reviews received for a particular Program

image

2 Likes

How it is done, please tell me.

Create a Rollup column against the relation column.

https://docs.glideapps.com/all/reference/data-editor/computed-columns/rollup

2 Likes

I want to count number of true or false status in switch columns and number of blank row in that column.
Tried several option with roll up, it gives total count of true and false without considering blank row. My requirement is to know how many true and how many blank row.
Please Help.

Can you show a screenshot of what you are trying to do? I think you can do this if you create another If Then column that looks at the switch as well as blank and sets the result to True. Then you can do the rollup against the new If Then column. I’m not sure though if I understand what you want. What do you mean by a blank row? Is it completely blank, or just only some columns are empty? Do you want a count of True, False, and Blank or do you want a count of just True and Blank?

1 Like

@Jeff_Hager Earlier it was not working tried all your mentioned way and then applied formula in sheet to achieve that. Today once again tried after your msg and worked absolutely fine. Now deleted additional formula from spreadsheet. Surprisingly seeing no blank data in switch columns, it is either true or false. Thank you for your suggestion.
Can you please tell me how to make switch data true by default, it is to be used facility management complain tracker, whenever user log a complain by default it should be true and when issue is closed user will have option to switch off, so that it will be recorded as complaint resolved. Presently all check box is by default false.

Here is a response I posted in a different thread:

In whatever sheet contains the form button, create a template column and fill the value with ‘true’. In the form, pass that value as a Column value directly to the sheet into your switch column. Later when viewing the complaint, display the switch column as a switch that can then be turned off.

Personally it makes more sense to me to keep the value as false and the set it to true once it’s resolved, but that is only my opinion. I’m sure you have your reasons for making it default to True.

1 Like

Hi There!

I’ve been trying to use a rollup column to count the number of matches in a relational column. (The relation column is set to find matches between 2 split text columns)

However, when I set up the rollup column - the relational column doesn’t appear as an option. In fact, none of the Relational columns in my sheet appear as options when setting up a Rollup column,

I think my case is almost exactly the same as the one in the link Jeff posted - but are there conditions where relational columns cannot be counted with rollup?

I am trying to break up a search query using split text. Then compare that against an array column with search terms to count how many individual terms match. Do you think this is a feasible way to do this?

Thanks in advance for any help!

Is your relation set to Match multiple? You cannot roll-up a single relation.

3 Likes

Thanks for the response David!

Yes - I believe the relational column is set to Match Multiple - had tried it both ways - but its set to match mutliple now.

This is a quick screenshot of what I’m trying to do - basically count the number of matches between the Keywords column and U_Search Query column (which are both split text - could that be the reason?), and the relation is in the Keyword-Search Relation Column. I don’t see that third column as an option when I create a rollup column.

Just for something to try, can you recreate the relation in a new column and try to create a Rollup on top of that new relation?

Hi Jeff - thanks for helping out!

Just recreated the same relation in a new column and didn’t have any luck (also tried reversing the order of the relation configuration).

When you say create a relation on top of that new relation - which is the second column I should be using in the “on-top” relation - the original relation?

I think I can’t use a relation column as an input to a relation column (please correct me if wrong)? Just want to make sure I’m understanding your suggestion

Sorry, I meant to say a Rollup (not relation) on top of the new relation. I’ve corrected it.

Got it thanks Jeff! Yes tried that and didn’t have any luck. Any other thoughts would be really appreciated!

Could it be because the two input columns to the relational are in the same sheet? (though I tried relating to a column on a separate sheet but still didn’t have any luck)

This is actually the very last thing I am trying to fix before my app is ready and have spent a few days on it -

Glide has been a truly an amazing tool - everything else in my app works perfectly!

Just figured out the relation column - but realized the underlying relation setup is not what I wanted.

Can a relation be used to count the number of matches between 2 split text columns? (or is there any . other / better way to do this within Glide?).

As mentioned before - I want to compare the individual words of a search query to keywords and get the number of matches.

Are you trying to have a count of rows that have a match or are you trying to count each individual match within the same row?