Show sum of numbers after multiple filtering

Hi guys,

getting used to glide.:wink:
In a dashboard i want to show 2 sum field of filtered entries (request is done via a custom search field like in the example below) beside the complete results.
It should show:
Sum of the numbers
Count to the entries

Can anybody help here? Would be really great.
Thanks, Sabine

Since you are using a custom search (which I assume is a text entry component), you should be able to use that same value in your table, and then use an IF column to return the numbers for the rows that match the search. Then you can use a Rollup column to sum those searched row values in the IF column, as well as another Rollup to count the number rows in the IF column.

5 Likes

Hola!

The other option if you donā€™t want to take the way that Jeff mentioned above is create a relation and create your own filter(s).

Depending on case and effort, I would take this procedure https://community.glideapps.com/t/multi-filters-using-relations-a-new-way/ but we need to advice you, the custom search or custom forms will consume a lot of edits due to current Glide policy.

Saludos!

4 Likes

Thanks, @Jeff_Hager. I get the basic concept but iā€™m still too much a beginner to be able to set this up. Also checked with Chat GPT but it doesnā€™t understand the IF ELSE column from glide completely.:wink:

Could you give me a hint reg. the first 2 steps? This would be kind.
So, i have to check the searchInput field (which contains the text entry input) with boolean or how?
And, in the IF ELSE i can only select the columns and no formula.
I started with:
IF searchInput INCLUDES svsearchfield (this is a singlevalue field connected to the main database)
THEN
and here iā€™m lost.
Iā€™d have thought that i should increment a number or something but i can only select from the available columns.

Thank you and good night.

First of all, can you show how you are filtering the data currently?

I went with the approach you proposed.

This is the live dashboard so far.
Thank you.

OK, so I see that you are using this filter function in glide.

image

What I would recommend is to instead move that logic into the table, by creating an IF column that should look something like this:

IF FILMTITEL does not include filterFilm
Then 'false'
IF PRODUCKTIONSFIRMA does not include filterFirma
Then 'false'
IF searchField does not include searchinput
Then 'false'
IF FORDERJAHR does not include Jahr
Then 'false'
ELSE 'true'

You can then use the resulting true/false to filter your collection.

Once you have that, then you can duplicate the IF column and instead of returning true or false, you return your number column or zero. So only the rows that match your criteria should have an IF column with ā€˜trueā€™ and an IF column with a number that is not zero. The rest should be false and zero.

With that, you can go back to your single row table and create two rollup columns. The first rollup column will COUNT all of the ā€˜trueā€™ values:
image

And the second rollup will SUM the numbers that are not zero.
image

2 Likes

Hi Jeff,
Thanks a lot, again very, very helpful.

I think i canā€™t easily transfer the filter logic to the tables because i use this separate single row table. Some of the parameters/values are not visible there or some are not visible in the main database.
Like, this


the searchInput field is in the ā€œworkingā€ table and i canā€™t access it via the ā€œalleā€ table. I tried this relation thing, but it didnā€™t work. Is it maybe because my main table is connected to Airtable?

Use a Single Value column to transfer the value in the working table to your data table.

1 Like

Yep, but iā€™d receive only one dedicated value related to below selection.
I would need the whole bunch of data. In Airtable you link the whole column and not a single value.

If itā€™s a single row table, you should select ā€œFirstā€. This will take the first (only) value in the column and apply it to all rows in the destination table.
If you have multiple values (columns) in your working table that you need in your data table, then youā€™ll need one single value column for each.

PS. Glide is not AirTable - so what works in AirTable doesnā€™t necessarily work in the same way in Glide :wink:

3 Likes