# Crossing multiple categories in a chart

**URL:** <https://community.glideapps.com/t/crossing-multiple-categories-in-a-chart/50939>\
**Category:** Ask for Help\
**Created:** [October 5, 2022, 4:40pm UTC](https://community.glideapps.com/t/crossing-multiple-categories-in-a-chart/50939 "2022-10-05T16:40:15Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lucas\_Malguy1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lucas_malguy1/32/54607_2.png) [@Lucas\_Malguy1](https://community.glideapps.com/u/Lucas_Malguy1)\
**Post date:** [October 5, 2022, 4:40pm UTC](https://community.glideapps.com/t/crossing-multiple-categories-in-a-chart/50939/1 "2022-10-05T16:40:15Z")

</div>

Hello every one !

I have been stuck for hours on this issue.

My app is a simple expenses & budget tracker.  
I have 3 mains tabs : **monthly report, expenses, categories.**

When I add an expense, this one is tied to a date (month & year) and a category.  
In my category tab, i can select a category and then see all the expenses in it grouped by month. I want to show a graph where I see the average expense of this category per month. BUT not per unique month (June 2021 & June 2022) but global month : all the months of June.

This is what I can’t manage to do.  
In the first picture you see a graph where I see the sum of the expenses in this category per month, but in 10 yeart I will have 120 months which is not convenient. So i tried to group by month (picture 2), but it makes the addition of them, and i can’t seem to find a way to divide it.  
You can take as an example january where I want an average of 259€ (518/2)

 ![Capture d’écran 2022-10-05 à 18.36.05](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/4/04c4fc8670c07ee0f02598346f4fed987c2e92f2.jpeg)  
 ![Capture d’écran 2022-10-05 à 18.38.11](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/c/7c9f50cb0efd15fd0f3a6f8299ae6ca91edc9b4d.jpeg)

Thanks in advance !  
Lucas

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [October 6, 2022, 12:35am UTC](https://community.glideapps.com/t/crossing-multiple-categories-in-a-chart/50939/2 "2022-10-06T00:35:12Z")

</div>

I think what you can do here is:

- Add a helper table with 12 rows to store 12 months (from January to December).

- I assume you already derive the month name from each expense in the Expenses table. (There are a couple ways to do this, one is deriving the month index first using a math column: MONTH(Date) - 1, then use a single column to point to the column of names in the first step, choosing “from start”)

- Another assumption: You’re writing the category name to the Expenses table (it would be better if you write a category ID since the name can change). On entry to each category details view, have a set column action to write the category name/category ID back to your user profiles row.

- Go to the helper table in the 1st step, create a template using the Month Name - Category Name/ID. E.g: January - Soirées & Sorties.

- Go to the Expenses table, create the same template.

- Make a multiple relation from the helper table to the expenses table using the 2 columns above.

- Have a rollup column to get the average of each month in the helper table.

Then point your chart to that helper table, and display the rollup average column.

Maybe someone will have a better way than me, but at first thought I think this would work.

---

<div class="post-metadata">

**Author:** ![Lucas\_Malguy1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lucas_malguy1/32/54607_2.png) [@Lucas\_Malguy1](https://community.glideapps.com/u/Lucas_Malguy1)\
**Post date:** [October 6, 2022, 1:47pm UTC](https://community.glideapps.com/t/crossing-multiple-categories-in-a-chart/50939/3 "2022-10-06T13:47:10Z")

</div>

Thanks for your answer !  
I think that this indeed would work !  
I already have a helper table for the months, and created a template in my expense table (January - Soirées & sorties). But I don’t understand this step :

`Another assumption: You’re writing the category name to the Expenses table (it would be better if you write a category ID since the name can change). On entry to each category details view, have a set column action to write the category name/category ID back to your user profiles row.`

How do I add the category in the user profile row ? I think that’s the missing part 😅

---

<div class="post-metadata">

**Author:** ![Lucas\_Malguy1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lucas_malguy1/32/54607_2.png) [@Lucas\_Malguy1](https://community.glideapps.com/u/Lucas_Malguy1)\
**Post date:** [October 6, 2022, 2:10pm UTC](https://community.glideapps.com/t/crossing-multiple-categories-in-a-chart/50939/4 "2022-10-06T14:10:14Z")

</div>

You create manually one template column by category (+month) in the helper table is that it ?

EDIT : Tried it, and it works thanks a lot!

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [October 6, 2022, 2:42pm UTC](https://community.glideapps.com/t/crossing-multiple-categories-in-a-chart/50939/5 "2022-10-06T14:42:27Z")

</div>

> [@Lucas\_Malguy1](#):
>
> How do I add the category in the user profile row ? I think that’s the missing par

You use a set column action on entry to the category’s details screen. If it’s configured correctly, you can point it to the user profile’s row and use that value later on in the template configuration.

---

<div class="post-metadata">

**Author:** ![Lucas\_Malguy1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lucas_malguy1/32/54607_2.png) [@Lucas\_Malguy1](https://community.glideapps.com/u/Lucas_Malguy1)\
**Post date:** [October 7, 2022, 2:04pm UTC](https://community.glideapps.com/t/crossing-multiple-categories-in-a-chart/50939/6 "2022-10-07T14:04:52Z")

</div>

The solution i tried with your help works :

> You create manually one template column by category (+month) in the helper table is that it ?

But its kind of hand made, I have to create these template columns by category which is not convenient if i change, modify or add new one. I think i get the logic of your idea :

> You use a set column action on entry to the category’s details screen. If it’s configured correctly, you can point it to the user profile’s row and use that value later on in the template configuration.

But I don’t really understand how you do it ?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [October 8, 2022, 12:35am UTC](https://community.glideapps.com/t/crossing-multiple-categories-in-a-chart/50939/7 "2022-10-08T00:35:24Z")

</div>

> [@Lucas\_Malguy1](#):
>
> I have to create these template columns by category which is not convenient if i change, modify or add new one

Why do you have to create it by category though? If you point the template column to the category name then you should not have to manually change anything.

---

<div class="post-metadata">

**Author:** ![Lucas\_Malguy1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lucas_malguy1/32/54607_2.png) [@Lucas\_Malguy1](https://community.glideapps.com/u/Lucas_Malguy1)\
**Post date:** [October 9, 2022, 11:43am UTC](https://community.glideapps.com/t/crossing-multiple-categories-in-a-chart/50939/8 "2022-10-09T11:43:39Z")

</div>

But I didn’t manage to do it which is why my template column in the helper table is “manual” : MONTH _Soirées & sorties_, where MONTH depends on the row and the italic text, I wrote it.

 ![Capture d’écran 2022-10-09 à 13.43.07](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/f/0f0f7ad207ffb531fea325613cf70afe1955c11a.jpeg)  
 ![Capture d’écran 2022-10-09 à 13.40.45](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/0/50b9abae3c933cb28ef45648f64def71531cc898.jpeg)

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [October 10, 2022, 12:34am UTC](https://community.glideapps.com/t/crossing-multiple-categories-in-a-chart/50939/9 "2022-10-10T00:34:13Z")

</div>

> [@ThinhDinh](#):
>
> On entry to each category details view, have a set column action to write the category name/category ID back to your user profiles row.

I think you’re missing this part.

---

<div class="post-metadata">

**Author:** ![Lucas\_Malguy1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lucas_malguy1/32/54607_2.png) [@Lucas\_Malguy1](https://community.glideapps.com/u/Lucas_Malguy1)\
**Post date:** [October 10, 2022, 11:30am UTC](https://community.glideapps.com/t/crossing-multiple-categories-in-a-chart/50939/10 "2022-10-10T11:30:31Z")

</div>

Exactly, that’s what I don’t understand.
