# Show sum of numbers after multiple filtering

**URL:** <https://community.glideapps.com/t/show-sum-of-numbers-after-multiple-filtering/60135>\
**Category:** Ask for Help\
**Created:** [April 4, 2023, 3:02pm UTC](https://community.glideapps.com/t/show-sum-of-numbers-after-multiple-filtering/60135 "2023-04-04T15:02:28Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![pluzgi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pluzgi/32/56533_2.png) [@pluzgi](https://community.glideapps.com/u/pluzgi)\
**Post date:** [April 4, 2023, 3:02pm UTC](https://community.glideapps.com/t/show-sum-of-numbers-after-multiple-filtering/60135/1 "2023-04-04T15:02:29Z")

</div>

Hi guys,

getting used to glide.😉  
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

 ![Bildschirm­foto 2023-04-04 um 16.57.20](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/9/b9a3c1aefadd81411b961cb8383bf111295e9728.jpeg)

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [April 4, 2023, 3:34pm UTC](https://community.glideapps.com/t/show-sum-of-numbers-after-multiple-filtering/60135/2 "2023-04-04T15:34:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [April 4, 2023, 3:48pm UTC](https://community.glideapps.com/t/show-sum-of-numbers-after-multiple-filtering/60135/3 "2023-04-04T15:48:34Z")

</div>

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/](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!

---

<div class="post-metadata">

**Author:** ![pluzgi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pluzgi/32/56533_2.png) [@pluzgi](https://community.glideapps.com/u/pluzgi)\
**Post date:** [April 4, 2023, 8:12pm UTC](https://community.glideapps.com/t/show-sum-of-numbers-after-multiple-filtering/60135/4 "2023-04-04T20:12:49Z")

</div>

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.😉

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.

 ![Bildschirm­foto 2023-04-04 um 22.11.43](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/6/16d19731f267bd2f924859ce7a0db2cbbffddc64.jpeg)

Thank you and good night.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [April 4, 2023, 8:26pm UTC](https://community.glideapps.com/t/show-sum-of-numbers-after-multiple-filtering/60135/5 "2023-04-04T20:26:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pluzgi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pluzgi/32/56533_2.png) [@pluzgi](https://community.glideapps.com/u/pluzgi)\
**Post date:** [April 4, 2023, 8:53pm UTC](https://community.glideapps.com/t/show-sum-of-numbers-after-multiple-filtering/60135/6 "2023-04-04T20:53:38Z")

</div>

I went with the approach you proposed.

- create a separate single row table with mostly user specific columns within it.
- then custom search field as described by Darren: [How to Add Custom Filters to @glideapps Pages - YouTube](https://www.youtube.com/watch?app=desktop&v=6C5pfmEzb8o)  
(inkl. searchfield template)  
 ![Bildschirm­foto 2023-04-04 um 22.52.07](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/f/0f2c5d2e73653ea92f0db66c7ca6e3ddd0555d70.jpeg)

This is the live dashboard so far.  
Thank you.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [April 4, 2023, 9:34pm UTC](https://community.glideapps.com/t/show-sum-of-numbers-after-multiple-filtering/60135/7 "2023-04-04T21:34:59Z")

</div>

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

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/9/b9b541252485d31e6ea00c6c7f4ab2485756e628.png)

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

```auto
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](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/d/5de0655f5b8fddb86023aca35ee0f06ea9c88520.png)

And the second rollup will SUM the numbers that are not zero.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/a/3a7781a71c1c8b034b9f55e4cf670f527669c76c.png)

---

<div class="post-metadata">

**Author:** ![pluzgi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pluzgi/32/56533_2.png) [@pluzgi](https://community.glideapps.com/u/pluzgi)\
**Post date:** [April 5, 2023, 9:23am UTC](https://community.glideapps.com/t/show-sum-of-numbers-after-multiple-filtering/60135/8 "2023-04-05T09:23:11Z")

</div>

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

 ![Bildschirm­foto 2023-04-05 um 11.16.39](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/0/d00c50b20ff67397475eedcf87a0b813c2bb9c1e.jpeg)  
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?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 5, 2023, 9:29am UTC](https://community.glideapps.com/t/show-sum-of-numbers-after-multiple-filtering/60135/9 "2023-04-05T09:29:40Z")

</div>

> [@pluzgi](#):
>
> the searchInput field is in the “working” table and i can’t access it via the “alle” table. I tried this relation thing,

Use a [Single Value](https://www.glideapps.com/docs/reference/computed-columns/single-value-column) column to transfer the value in the working table to your data table.

---

<div class="post-metadata">

**Author:** ![pluzgi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pluzgi/32/56533_2.png) [@pluzgi](https://community.glideapps.com/u/pluzgi)\
**Post date:** [April 5, 2023, 9:53am UTC](https://community.glideapps.com/t/show-sum-of-numbers-after-multiple-filtering/60135/10 "2023-04-05T09:53:40Z")

</div>

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.

 ![Bildschirm­foto 2023-04-05 um 11.52.25](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/4/54def98d8687c85a37ccba3e990cf727c6d3a496.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 5, 2023, 10:04am UTC](https://community.glideapps.com/t/show-sum-of-numbers-after-multiple-filtering/60135/11 "2023-04-05T10:04:17Z")

</div>

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 😉
