# How to sum values based on date (daily ,weekly, monthly)

**URL:** <https://community.glideapps.com/t/how-to-sum-values-based-on-date-daily-weekly-monthly/66313>\
**Category:** Ask for Help\
**Created:** [September 19, 2023, 12:12pm UTC](https://community.glideapps.com/t/how-to-sum-values-based-on-date-daily-weekly-monthly/66313 "2023-09-19T12:12:01Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darius\_Elijah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darius_elijah/32/62411_2.png) [@Darius\_Elijah](https://community.glideapps.com/u/Darius_Elijah)\
**Post date:** [September 19, 2023, 12:12pm UTC](https://community.glideapps.com/t/how-to-sum-values-based-on-date-daily-weekly-monthly/66313/1 "2023-09-19T12:12:01Z")

</div>

![Screenshot 2023-09-19 at 14.10.27](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/f/9f1a721435c10c0eaffb85d48622946320671136.jpeg)  
how to sum this data based on date.

---

<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:** [September 19, 2023, 12:19pm UTC](https://community.glideapps.com/t/how-to-sum-values-based-on-date-daily-weekly-monthly/66313/2 "2023-09-19T12:19:59Z")

</div>

I don’t see a Date column in your table?

But, a general approach to summarise data by date is as follows:

- Use a math column to convert the date to an integer in yyyymmdd format:

```auto
Year(Date)*10^4
+Month(Date)*10^2
+Day(Date)

```

- Create a multiple relation column that matches the math column with itself.
- Use a Rollup-\>Sum via the relation to sum the value/s that you’re interested in.

---

<div class="post-metadata">

**Author:** ![Darius\_Elijah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darius_elijah/32/62411_2.png) [@Darius\_Elijah](https://community.glideapps.com/u/Darius_Elijah)\
**Post date:** [September 19, 2023, 2:56pm UTC](https://community.glideapps.com/t/how-to-sum-values-based-on-date-daily-weekly-monthly/66313/3 "2023-09-19T14:56:14Z")

</div>

how do i create a multiple relation that matches the math column with itself.

---

<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:** [September 19, 2023, 3:26pm UTC](https://community.glideapps.com/t/how-to-sum-values-based-on-date-daily-weekly-monthly/66313/4 "2023-09-19T15:26:17Z")

</div>

- Create a relation column.
- Select the ‘Multiple’ checkbox
- Configure it so the value in the math column matches the same math column in the same table. Match it to itself.

---

<div class="post-metadata">

**Author:** ![Darius\_Elijah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darius_elijah/32/62411_2.png) [@Darius\_Elijah](https://community.glideapps.com/u/Darius_Elijah)\
**Post date:** [September 20, 2023, 11:19am UTC](https://community.glideapps.com/t/how-to-sum-values-based-on-date-daily-weekly-monthly/66313/5 "2023-09-20T11:19:53Z")

</div>

![Screenshot 2023-09-20 at 13.16.27](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/0/c0166823285bde18cb34ef1f5cb5878a99a9ae22.jpeg)  
here is the date column  
 ![Screenshot 2023-09-20 at 13.17.08](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/8/d8ed7df2f4a18854137a27fe01c44b500d4b0e81.jpeg)  
here are the values i need to sum.  
 ![Screenshot 2023-09-20 at 13.19.01](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/d/bd7394d4d58a320f5278e1643388fec3fa9c2bea.jpeg)  
when i follow the steps it doesn’t solve the problem.

---

<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:** [September 20, 2023, 11:23am UTC](https://community.glideapps.com/t/how-to-sum-values-based-on-date-daily-weekly-monthly/66313/6 "2023-09-20T11:23:50Z")

</div>

> [@Darius\_Elijah](#):
>
> here are the values i need to sum.

Please be specific. Which column are the values in that you need to sum?

---

<div class="post-metadata">

**Author:** ![Darius\_Elijah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darius_elijah/32/62411_2.png) [@Darius\_Elijah](https://community.glideapps.com/u/Darius_Elijah)\
**Post date:** [September 20, 2023, 12:01pm UTC](https://community.glideapps.com/t/how-to-sum-values-based-on-date-daily-weekly-monthly/66313/7 "2023-09-20T12:01:49Z")

</div>

car total and suv total

---

<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:** [September 20, 2023, 12:21pm UTC](https://community.glideapps.com/t/how-to-sum-values-based-on-date-daily-weekly-monthly/66313/8 "2023-09-20T12:21:08Z")

</div>

Okay, so both of those columns are rollup columns.  
Do you want to sum the rolled up values, or do you want to sum the original values?

Whatever it is, it’s possible. You’re just not providing enough information for me to be able to help you.

---

<div class="post-metadata">

**Author:** ![Darius\_Elijah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darius_elijah/32/62411_2.png) [@Darius\_Elijah](https://community.glideapps.com/u/Darius_Elijah)\
**Post date:** [September 20, 2023, 1:57pm UTC](https://community.glideapps.com/t/how-to-sum-values-based-on-date-daily-weekly-monthly/66313/9 "2023-09-20T13:57:36Z")

</div>

I need to sum the roll up columns

---

<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:** [September 20, 2023, 2:00pm UTC](https://community.glideapps.com/t/how-to-sum-values-based-on-date-daily-weekly-monthly/66313/10 "2023-09-20T14:00:16Z")

</div>

Okay, so very first solution that I offered (math column, self relation, rollup) should do that.  
If that didn’t work for you, can you please show me how you configured each of the three columns, and how the result was different from what you expected.

---

<div class="post-metadata">

**Author:** ![Darius\_Elijah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darius_elijah/32/62411_2.png) [@Darius\_Elijah](https://community.glideapps.com/u/Darius_Elijah)\
**Post date:** [September 20, 2023, 6:54pm UTC](https://community.glideapps.com/t/how-to-sum-values-based-on-date-daily-weekly-monthly/66313/11 "2023-09-20T18:54:35Z")

</div>

![Screenshot 2023-09-20 at 20.50.54](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/c/fc895537e7402c8697187ca2b7f3510501423995.jpeg)  
I need the values totalled for the day  
 ![Screenshot 2023-09-20 at 20.51.12](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/8/b8bb48ce08b080e6f44843a0ffb072b75dca4369.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:** [September 20, 2023, 8:00pm UTC](https://community.glideapps.com/t/how-to-sum-values-based-on-date-daily-weekly-monthly/66313/12 "2023-09-20T20:00:40Z")

</div>

> [@Darren\_Murphy](#):
>
> Use a Rollup-\>Sum via the relation to sum the value/s that you’re interested in.

Did you create the rollup column that uses the relation as @Darren_Murphy mentioned?

---

<div class="post-metadata">

**Author:** ![Darius\_Elijah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darius_elijah/32/62411_2.png) [@Darius\_Elijah](https://community.glideapps.com/u/Darius_Elijah)\
**Post date:** [September 21, 2023, 1:24am UTC](https://community.glideapps.com/t/how-to-sum-values-based-on-date-daily-weekly-monthly/66313/13 "2023-09-21T01:24:38Z")

</div>

Yes I did. It does work. Great solution.  
I need to display the data in a dashbaord view.  
would I need to create a second table.  
and how do i do it monthly?

 ![Screenshot 2023-09-21 at 03.24.04](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/7/77d7baa4c68d13bf1db12eb904f7d8a0705777c2.jpeg)

 ![Screenshot 2023-09-21 at 03.23.09](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/3/f38a9fbe9b4d612e99a111cdccab9fc1322ee825.jpeg)

---

<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:** [September 21, 2023, 2:09am UTC](https://community.glideapps.com/t/how-to-sum-values-based-on-date-daily-weekly-monthly/66313/14 "2023-09-21T02:09:37Z")

</div>

To do it monthly, adjust the math formula so that it returns a unique value by month. Either of the following will work:

```auto
Year(Date)*12+Month(Date)

```

```auto
Year(Date)*10^4
+Month(Date)*10^2

```

Side note: You might want to consider giving your columns descriptive names. It’s okay when you only have a handful of columns, but once you have 50 or 100 columns you’ll have a tough time remembering what `New Column CA` is for 😉

---

<div class="post-metadata">

**Author:** ![Darius\_Elijah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darius_elijah/32/62411_2.png) [@Darius\_Elijah](https://community.glideapps.com/u/Darius_Elijah)\
**Post date:** [September 21, 2023, 1:27pm UTC](https://community.glideapps.com/t/how-to-sum-values-based-on-date-daily-weekly-monthly/66313/15 "2023-09-21T13:27:20Z")

</div>

Noted. I am having trouble displaying the data for daily as it is only showing the first row of the table, not the latest.

 ![Screenshot 2023-09-21 at 15.26.05](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/3/f3d1e7655ceab5f9fa62c9e333f2c1bbba02173b.jpeg)

---

<div class="post-metadata">

**Author:** ![Darius\_Elijah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darius_elijah/32/62411_2.png) [@Darius\_Elijah](https://community.glideapps.com/u/Darius_Elijah)\
**Post date:** [September 21, 2023, 11:41pm UTC](https://community.glideapps.com/t/how-to-sum-values-based-on-date-daily-weekly-monthly/66313/16 "2023-09-21T23:41:26Z")

</div>

I’m not sure what I am missing

---

<div class="post-metadata">

**Author:** ![biha](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/biha/32/84110_2.png) [@biha](https://community.glideapps.com/u/biha)\
**Post date:** [September 22, 2023, 1:08am UTC](https://community.glideapps.com/t/how-to-sum-values-based-on-date-daily-weekly-monthly/66313/17 "2023-09-22T01:08:31Z")

</div>

What i think is you can use the Single Value Column and choose latest?

---

<div class="post-metadata">

**Author:** ![ashiquemuneer](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ashiquemuneer/32/73259_2.png) [@ashiquemuneer](https://community.glideapps.com/u/ashiquemuneer)\
**Post date:** [April 6, 2024, 7:59am UTC](https://community.glideapps.com/t/how-to-sum-values-based-on-date-daily-weekly-monthly/66313/18 "2024-04-06T07:59:01Z")

</div>

@Darren_Murphy Hi, Thanks in advance for this great solution. 💗 Is there any way to sum by weekly?

---

<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 6, 2024, 8:06am UTC](https://community.glideapps.com/t/how-to-sum-values-based-on-date-daily-weekly-monthly/66313/19 "2024-04-06T08:06:49Z")

</div>

```auto
Year(Date)*10^2
+Weeknum(Date)

```
