# Sum values by month

**URL:** <https://community.glideapps.com/t/sum-values-by-month/68510>\
**Category:** Ask for Help\
**Created:** [December 8, 2023, 3:42pm UTC](https://community.glideapps.com/t/sum-values-by-month/68510 "2023-12-08T15:42:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicolas\_Maldonado](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nicolas_maldonado/32/36477_2.png) [@Nicolas\_Maldonado](https://community.glideapps.com/u/Nicolas_Maldonado)\
**Post date:** [December 8, 2023, 3:42pm UTC](https://community.glideapps.com/t/sum-values-by-month/68510/1 "2023-12-08T15:42:53Z")

</div>

Hi, I need to sum the values by month in order to create a dashboard of expenses. My first approach is to create a table with all the expenses and then do some calculations to display the data in the layout of the app.

 ![Captura de pantalla 2023-12-08 a la(s) 10.39.38 a.m.](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/3/7332ebeacf45bed22bbaaa4a20d014019615df4c.jpeg)

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [December 8, 2023, 5:33pm UTC](https://community.glideapps.com/t/sum-values-by-month/68510/2 "2023-12-08T17:33:16Z")

</div>

Ideas:

- Create a separate table with the time items along which you want to do rollups (sum, averages, count). Eg. Jan, Feb, … , Dec

- Try the Query column

---

<div class="post-metadata">

**Author:** ![Nicolas\_Maldonado](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nicolas_maldonado/32/36477_2.png) [@Nicolas\_Maldonado](https://community.glideapps.com/u/Nicolas_Maldonado)\
**Post date:** [December 9, 2023, 1:39am UTC](https://community.glideapps.com/t/sum-values-by-month/68510/3 "2023-12-09T01:39:16Z")

</div>

Can you provide an example? That table wouldnt affect too much the number of files in my app?

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [December 9, 2023, 2:36am UTC](https://community.glideapps.com/t/sum-values-by-month/68510/4 "2023-12-09T02:36:03Z")

</div>

You need to transform the date to yyyyMM format (math column: year\*100+month). Then you create a column with unique values from that yyyyMM column… then relate that Unique column to formatted date column… and sum that relations

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [December 9, 2023, 10:58am UTC](https://community.glideapps.com/t/sum-values-by-month/68510/5 "2023-12-09T10:58:59Z")

</div>

> [@Uzo](#):
>
> Then you create a column with unique values from that yyyyMM column

I think it’s important to plan what one will want to see in the layout. Is it a collection or chart per calendar year, is it a collection or chart of the last n months rolling?

If the time frame is static (months, quarters or years for instance, non-rolling), then I like the idea of creating a separate table with the unique values that you would want to see on the x axis (for instance Uzo’s yyyyMM, which would be months of year yyyy).

> [@Uzo](#):
>
> then relate that Unique column to formatted date column

A relation is fine. But I do think a Query column here would also work fine, it’s more intuitive and versatile than a Relation column.

---

<div class="post-metadata">

**Author:** ![Nicolas\_Maldonado](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nicolas_maldonado/32/36477_2.png) [@Nicolas\_Maldonado](https://community.glideapps.com/u/Nicolas_Maldonado)\
**Post date:** [December 9, 2023, 1:28pm UTC](https://community.glideapps.com/t/sum-values-by-month/68510/6 "2023-12-09T13:28:05Z")

</div>

The app is intended to be an expense tracker. I just want to log expenses by date and thought of having just one table with all of them. Then in the layout Id like to see what have I spent for a particular month or category. It should be as simple as that. Im new to glide and trying to keep up with the feedback but Im not familiar with what you have advised.
