# Help in sum by date and label

**URL:** <https://community.glideapps.com/t/help-in-sum-by-date-and-label/80089>\
**Category:** Ask for Help\
**Created:** [February 16, 2025, 3:43pm UTC](https://community.glideapps.com/t/help-in-sum-by-date-and-label/80089 "2025-02-16T15:43:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spiro](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/spiro/32/57073_2.png) [@Spiro](https://community.glideapps.com/u/Spiro)\
**Post date:** [February 16, 2025, 3:43pm UTC](https://community.glideapps.com/t/help-in-sum-by-date-and-label/80089/1 "2025-02-16T15:43:38Z")

</div>

Hi, I am having some trouble using relations/rollup columns. I’m supposed to use those to sum month total and total by label, but I am not sure how.  
This is what I have:

| Date | User | Date2Num math column | Label | Amount |
| --- | --- | --- | --- | --- |
| 1/10/2025 | User 1 | Math date 2 number | Label 1 | 10 |
| 1/11/2015 | User 1 | Math date 2 number | Label 2 | 20 |
| 2/10/2025 | User 1 | Math date 2 number | Label 1 | 30 |
| 2/11/2025 | User 2 | Math date 2 number | Label 1 | 50 |
| 2/12/2025 | User 2 | Math date 2 number | Lable 2 | 70 |

So I created a math column that calculates date 2 number. That works OK. Now I am supposed to create a relations column, but to what?? And after that I should sum/rollup that relations column?

EDIT1:  
By the way, I tried matching Label to Label column (which makes no sense, but I read somewhere that that is the way to go) but all I get are Users from column 2.

---

<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:** [February 16, 2025, 5:29pm UTC](https://community.glideapps.com/t/help-in-sum-by-date-and-label/80089/2 "2025-02-16T17:29:44Z")

</div>

Use a query column if you are comparing more than one column. Creating a query linking the label to the row label and the math column to the row math column.

> [@Spiro](#):
>
> I tried matching Label to Label column (which makes no sense

It makes sense because you are trying to find matching rows with the same label.

> [@Spiro](#):
>
> all I get are Users from column 2.

It doesn’t matter which column the relation randomly chose to show. Relations return rows. Not columns. What’s important is that it finds the matching rows you want.

---

<div class="post-metadata">

**Author:** ![Spiro](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/spiro/32/57073_2.png) [@Spiro](https://community.glideapps.com/u/Spiro)\
**Post date:** [February 16, 2025, 7:07pm UTC](https://community.glideapps.com/t/help-in-sum-by-date-and-label/80089/3 "2025-02-16T19:07:58Z")

</div>

OK, So when the relations column shows “User1, User2” it is showing all the rows that match the relations. How do I sum by date or label then using rollup? I am not comparing 2 column at the same time. Sum by month, and another would be sum by Label.

---

<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:** [February 17, 2025, 12:21am UTC](https://community.glideapps.com/t/help-in-sum-by-date-and-label/80089/4 "2025-02-17T00:21:14Z")

</div>

Is the end result intended to be used as a number for reporting, or in a chart?

> [@Spiro](#):
>
> OK, So when the relations column shows “User1, User2” it is showing all the rows that match the relations.

Yes, that’s correct.

> [@Spiro](#):
>
> How do I sum by date or label then using rollup? I am not comparing 2 column at the same time. Sum by month, and another would be sum by Label.

So by your sample data, you need:

- Sum of amounts for January 2025 and February 2025.
- Sum of amounts by Label 1 and Label 2.

Is that correct?

---

<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:** [February 17, 2025, 2:28am UTC](https://community.glideapps.com/t/help-in-sum-by-date-and-label/80089/5 "2025-02-17T02:28:52Z")

</div>

> [@Unique values to be added to new table](https://community.glideapps.com/t/unique-values-to-be-added-to-new-table/79978/2):
>
> You can use the technique described below:

---

<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:** [February 17, 2025, 5:29am UTC](https://community.glideapps.com/t/help-in-sum-by-date-and-label/80089/6 "2025-02-17T05:29:10Z")

</div>

If there is no correlation between date and user, you can created separate relations for each and then create Rollup columns to sum amounts through those relations.

---

<div class="post-metadata">

**Author:** ![Spiro](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/spiro/32/57073_2.png) [@Spiro](https://community.glideapps.com/u/Spiro)\
**Post date:** [February 17, 2025, 6:50am UTC](https://community.glideapps.com/t/help-in-sum-by-date-and-label/80089/7 "2025-02-17T06:50:43Z")

</div>

@ThinhDinh  
Yes, that is correct. I was thinking of using this as a line chart (monthly sum) and bar chart (Labels on x axis), but it could be just a number to display somewhere in the app.

I managed to do a “if then” column to display only single month, and then “rollup” column for “if then” column. That seems way too many columns to display just a sum? I would need 24 for 12 months and another 20 for 10 labels. Is there a more efficient way?

---

<div class="post-metadata">

**Author:** ![Spiro](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/spiro/32/57073_2.png) [@Spiro](https://community.glideapps.com/u/Spiro)\
**Post date:** [February 17, 2025, 12:53pm UTC](https://community.glideapps.com/t/help-in-sum-by-date-and-label/80089/8 "2025-02-17T12:53:18Z")

</div>

Looking at this: [Dynamically Filter your Data by TIMEFRAMES](https://www.youtube.com/watch?v=pApLeMYHFzE) seems to be what I might need. And I think I found my fault, after relation column is created you get another “source” in the options which points to that relation. I was pointing to Table-\>RelationColumn instead of Relation-\>Amount
