# Filter rollup fields for a planning tool

**URL:** <https://community.glideapps.com/t/filter-rollup-fields-for-a-planning-tool/37187>\
**Category:** Ask for Help\
**Created:** [January 14, 2022, 5:23pm UTC](https://community.glideapps.com/t/filter-rollup-fields-for-a-planning-tool/37187 "2022-01-14T17:23:54Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charlie1](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@Charlie1](https://community.glideapps.com/u/Charlie1)\
**Post date:** [January 14, 2022, 5:23pm UTC](https://community.glideapps.com/t/filter-rollup-fields-for-a-planning-tool/37187/1 "2022-01-14T17:23:54Z")

</div>

Hi,

I am trying to filter a rollup field. Is that possible ?  
I am trying to do a very simple planning tool but struggle.  
Here is a loom that explains my issue in more details : [Loom | Free Screen & Video Recording Software](https://www.loom.com/share/79c97c336b014f5cb45680a316f98488)

Thanks !!

Charlie

---

<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:** [January 14, 2022, 5:36pm UTC](https://community.glideapps.com/t/filter-rollup-fields-for-a-planning-tool/37187/2 "2022-01-14T17:36:22Z")

</div>

Create a template that joins the place and name together. Do that in any table that is needed for your relation. Then have your relation use those template columns. Then your rollup should only pull data for the matching place/name.

---

<div class="post-metadata">

**Author:** ![Charlie1](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@Charlie1](https://community.glideapps.com/u/Charlie1)\
**Post date:** [January 14, 2022, 6:25pm UTC](https://community.glideapps.com/t/filter-rollup-fields-for-a-planning-tool/37187/3 "2022-01-14T18:25:43Z")

</div>

Thanks Jeff ! That works but it will quickly become unmanageable : the places I have are always changing. I have new ones and ones that I need to delete constantly. I could create an automation of course but that seems overkill. Plus let’s say I have 100 places and 100 names, that means I need to create a template with 10000 lines !  
Is there really no other way ?

---

<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:** [January 14, 2022, 6:35pm UTC](https://community.glideapps.com/t/filter-rollup-fields-for-a-planning-tool/37187/4 "2022-01-14T18:35:48Z")

</div>

You only create a template column once and it dynamically populates based on the value in the place column and the value in the name column. I don’t understand how it would become unmanageable. It’s only two columns (one in each table) using values you already have in those table. How do you expect to create a relation based on both place and name if you don’t use a template column to join them together?

The template column can be as simple as ‘P N’ and you replace P and N with the Place column and the Name column respectively. I don’t understand what you mean by creating a template column with 10000 lines.

---

<div class="post-metadata">

**Author:** ![Charlie1](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@Charlie1](https://community.glideapps.com/u/Charlie1)\
**Post date:** [January 15, 2022, 3:40pm UTC](https://community.glideapps.com/t/filter-rollup-fields-for-a-planning-tool/37187/5 "2022-01-15T15:40:06Z")

</div>

I think there is definitely something I’m missing here. I really don’t understand the method you’re describing : I cannot add a name column to my place table as there can be many names to the same place. Still, being inspired by the concatenation of places and names that your method uses, I managed to do it by another method and here it is :

> **[No name - 15 January 2022](https://www.loom.com/share/b317dccd79b34aada296495547ff3076)**

Do let me know if you find a better way ! (And please do explain the method you’re describing above, I would love to understand it 🙂 )

---

<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:** [January 15, 2022, 3:47pm UTC](https://community.glideapps.com/t/filter-rollup-fields-for-a-planning-tool/37187/6 "2022-01-15T15:47:05Z")

</div>

The template columns that Jeff was describing should be created in the Glide Data Editor, not in your Google Spreadsheet.

> **[Template Column](https://docs.glideapps.com/all/topics/computed-columns/primary/template-column)**
>
> Create labels or messages based on other columns in your table

---

<div class="post-metadata">

**Author:** ![Charlie1](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@Charlie1](https://community.glideapps.com/u/Charlie1)\
**Post date:** [January 15, 2022, 3:52pm UTC](https://community.glideapps.com/t/filter-rollup-fields-for-a-planning-tool/37187/7 "2022-01-15T15:52:24Z")

</div>

Thanks Darren ! The template column is simply used to join two existing columns. Using a template columns in Glide or a concatenate in Google sheets achieves the same thing.  
The issue is elsewhere 😉

---

<div class="post-metadata">

**Author:** ![Charlie1](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@Charlie1](https://community.glideapps.com/u/Charlie1)\
**Post date:** [January 15, 2022, 3:55pm UTC](https://community.glideapps.com/t/filter-rollup-fields-for-a-planning-tool/37187/8 "2022-01-15T15:55:09Z")

</div>

To complicate things, I not only want the number of hours per employee and per place but I also want to be able to filter by month.  
Basically I want to have the number of hours an employee works in a place for a given month…

---

<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:** [January 15, 2022, 4:11pm UTC](https://community.glideapps.com/t/filter-rollup-fields-for-a-planning-tool/37187/9 "2022-01-15T16:11:33Z")

</div>

> [@Charlie1](#):
>
> The template column is simply used to join two existing columns

oh, it can be used for much, much more than that.  
But anyway…

> [@Charlie1](#):
>
> To complicate things, I not only want the number of hours per employee and per place but I also want to be able to filter by month.  
> Basically I want to have the number of hours an employee works in a place for a given month…

How do you envisage this will work on the app user interface?  
ie. Would you expect to first select an employee, and then select a month, and be presented with a list of locations and hours worked?  
Or something else?  
If you can describe your desired end result, we can help you get there.

---

<div class="post-metadata">

**Author:** ![Charlie1](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@Charlie1](https://community.glideapps.com/u/Charlie1)\
**Post date:** [January 15, 2022, 4:39pm UTC](https://community.glideapps.com/t/filter-rollup-fields-for-a-planning-tool/37187/10 "2022-01-15T16:39:22Z")

</div>

In our case it is simply used for that, isn’t it ? Again, super interested in knowing more about this feature !  
The desired end result is first to select a place, then select a month and be presented with a list of employees and hours worked.

---

<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:** [January 15, 2022, 4:55pm UTC](https://community.glideapps.com/t/filter-rollup-fields-for-a-planning-tool/37187/11 "2022-01-15T16:55:13Z")

</div>

> [@Charlie1](#):
>
> In our case it is simply used for that, isn’t it ? Again, super interested in knowing more about this feature !

Yes, but creating it in the Google Spreadsheet rules out the possibility of creating anything dynamic that will work in real time.

> [@Charlie1](#):
>
> The desired end result is first to select a place, then select a month and be presented with a list of employees and hours worked.

Okay. Please give me a short while and I’ll make a sample app to show how that can be done, that you can copy. (It’s quicker to do that than it is to describe all the steps).

---

<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:** [January 15, 2022, 5:36pm UTC](https://community.glideapps.com/t/filter-rollup-fields-for-a-planning-tool/37187/12 "2022-01-15T17:36:56Z")

</div>

> [@Charlie1](#):
>
> The desired end result is first to select a place, then select a month and be presented with a list of employees and hours worked.

Here you go. Make a copy of this, study it and let me know if you have questions.

[https://ideal-truck-2222.glideapp.io/](https://ideal-truck-2222.glideapp.io/)

---

<div class="post-metadata">

**Author:** ![Charlie1](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@Charlie1](https://community.glideapps.com/u/Charlie1)\
**Post date:** [January 15, 2022, 6:36pm UTC](https://community.glideapps.com/t/filter-rollup-fields-for-a-planning-tool/37187/13 "2022-01-15T18:36:31Z")

</div>

Wow ! Thank you ! Now I understand why I couldn’t make sense of the method just with the indication “create a template”.  
So the short answer is you create a “temp table” to store the values of your filters. That’s pretty neat ! The only thing is, because there is so many temp columns, the computed and filtered data is not stored anywhere (and I kinda wanted to be able to easily extract it).  
I will look into it and see how I can mix all of these methods together to reach my objective.  
Again thank you very much Darren and Jeff !

---

<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:** [January 15, 2022, 6:44pm UTC](https://community.glideapps.com/t/filter-rollup-fields-for-a-planning-tool/37187/14 "2022-01-15T18:44:03Z")

</div>

I must have completely misunderstood your goal. In your first video, you showed the Chantiers table which did in fact have a Place column and a Name column. It appeared that you were attempting to create a relation to the Planning table which also had a Place column and a Name column. That’s why I assumed that you could use a template column in each table to join the Place and Name and then have the relation use those template columns instead of just the place. This would have allowed the rollup column to only show a total for the place/name combinations that you had in both tables.

I now see that you have removed that Name column from the Chantiers table, so the problem is a little more clear to me.

---

<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:** [January 16, 2022, 1:39am UTC](https://community.glideapps.com/t/filter-rollup-fields-for-a-planning-tool/37187/15 "2022-01-16T01:39:44Z")

</div>

> [@Charlie1](#):
>
> So the short answer is you create a “temp table” to store the values of your filters. That’s pretty neat !

The “Report” table that you see in the sample app isn’t strictly necessary, but I added it in this case as it keeps things a bit cleaner, and makes it easier to see how it works. Those user specific columns and screen could have been attached to any of the other tables.

> [@Charlie1](#):
>
> The only thing is, because there is so many temp columns, the computed and filtered data is not stored anywhere (and I kinda wanted to be able to easily extract it).

This is possible, and this is where you’ll find template columns useful. Depending on what you want, all sorts of options are available - even creating a CSV file and emailing it yourself if that was what you wanted.

Now that you’ve had a look, there are a couple of other things about that sample that I’ll point out:

- You’ll notice that there is no Google Spreadsheet attached. I did that deliberately in order to demonstrate that you don’t need any funky spreadsheet formulas or data manipulation to do any of this. It can all be done in Glide.
- You’ll also notice that Person Names only appear in one table (Users), and Place names only appear in one table (Places). The Planning table doesn’t contain either, but rather references to each (Who/Where). This non-duplication of data is generally considered a good practice. It means if you need to change a name, it only needs to be changed in one place.
