# Aggregate by user -\> date -\> some metric. Rollup doesnt seem to work?

**URL:** <https://community.glideapps.com/t/aggregate-by-user-date-some-metric-rollup-doesnt-seem-to-work/28697>\
**Category:** Ask for Help\
**Created:** [July 4, 2021, 7:35am UTC](https://community.glideapps.com/t/aggregate-by-user-date-some-metric-rollup-doesnt-seem-to-work/28697 "2021-07-04T07:35:51Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bharat\_R](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/bharat_r/32/28664_2.png) [@Bharat\_R](https://community.glideapps.com/u/Bharat_R)\
**Post date:** [July 4, 2021, 7:35am UTC](https://community.glideapps.com/t/aggregate-by-user-date-some-metric-rollup-doesnt-seem-to-work/28697/1 "2021-07-04T07:35:51Z")

</div>

I am creating an app where users can enter their step count daily and see how their friends are doing in total as well.

For this to work I need to

1. Show each user their step count only
2. For each user group step counts by date

For 1, I am using row owner. When I do this the entries are limited to that users row. However when I do a rollup, the rollup also counts all the rows for that user.

For 2, How do I aggregate by date.

User table: User, Email, Total steps  
Step table: User, Email, Date, Steps. Each date can have multiple entries.

This might sound like a complicated question. Let me know if its confusing and i can clarify. Hope someone can help.

---

<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:** [July 4, 2021, 7:40am UTC](https://community.glideapps.com/t/aggregate-by-user-date-some-metric-rollup-doesnt-seem-to-work/28697/2 "2021-07-04T07:40:23Z")

</div>

you are trying to do this in Glide table or Google Sheet?  
In glide, you have to rollup user specific column with steps data… if you put step data to non user specific column… it will count all users

---

<div class="post-metadata">

**Author:** ![Bharat\_R](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/bharat_r/32/28664_2.png) [@Bharat\_R](https://community.glideapps.com/u/Bharat_R)\
**Post date:** [July 4, 2021, 7:41am UTC](https://community.glideapps.com/t/aggregate-by-user-date-some-metric-rollup-doesnt-seem-to-work/28697/3 "2021-07-04T07:41:15Z")

</div>

Currently using Glide table. But can change to sheet if that works better too

---

<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:** [July 4, 2021, 7:44am UTC](https://community.glideapps.com/t/aggregate-by-user-date-some-metric-rollup-doesnt-seem-to-work/28697/4 "2021-07-04T07:44:40Z")

</div>

in GS all you have to do is use countif formula, and in glide you have to put steps count in user specific column and roll up sum

---

<div class="post-metadata">

**Author:** ![Bharat\_R](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/bharat_r/32/28664_2.png) [@Bharat\_R](https://community.glideapps.com/u/Bharat_R)\
**Post date:** [July 4, 2021, 7:46am UTC](https://community.glideapps.com/t/aggregate-by-user-date-some-metric-rollup-doesnt-seem-to-work/28697/5 "2021-07-04T07:46:59Z")

</div>

Sorry how does countif aggregate by date?

---

<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:** [July 4, 2021, 7:48am UTC](https://community.glideapps.com/t/aggregate-by-user-date-some-metric-rollup-doesnt-seem-to-work/28697/6 "2021-07-04T07:48:04Z")

</div>

count if the date is …

---

<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:** [July 4, 2021, 7:49am UTC](https://community.glideapps.com/t/aggregate-by-user-date-some-metric-rollup-doesnt-seem-to-work/28697/7 "2021-07-04T07:49:11Z")

</div>

how do you keep steps data? each record separate row?

---

<div class="post-metadata">

**Author:** ![Bharat\_R](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/bharat_r/32/28664_2.png) [@Bharat\_R](https://community.glideapps.com/u/Bharat_R)\
**Post date:** [July 4, 2021, 7:51am UTC](https://community.glideapps.com/t/aggregate-by-user-date-some-metric-rollup-doesnt-seem-to-work/28697/8 "2021-07-04T07:51:07Z")

</div>

Yeah but users can enter multiple times in a day. I think I am getting what you mean. Let me try and come back 🙂

---

<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:** [July 4, 2021, 7:52am UTC](https://community.glideapps.com/t/aggregate-by-user-date-some-metric-rollup-doesnt-seem-to-work/28697/9 "2021-07-04T07:52:45Z")

</div>

so you can use formula… filter(sum(…), user=…, date=…))

---

<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:** [July 4, 2021, 7:54am UTC](https://community.glideapps.com/t/aggregate-by-user-date-some-metric-rollup-doesnt-seem-to-work/28697/10 "2021-07-04T07:54:56Z")

</div>

in Glide to sum each user and day separately… thats very complicated task, for total steps just roll sum on USC

---

<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:** [July 4, 2021, 2:01pm UTC](https://community.glideapps.com/t/aggregate-by-user-date-some-metric-rollup-doesnt-seem-to-work/28697/11 "2021-07-04T14:01:32Z")

</div>

Since you are sharing data with other users, Row Owners would not work well for you here, because this will prevent users from seeing other user’s data. Same with user specific columns. They also prevent others from seeing the data. I’m guessing with what you want to achieve, I would avoid row owners and user specific columns.

To get counts, what I would do is create a template column that combines the Email and Date columns.  
Then you can create a multiple relation that takes that template column and relates it back to itself.  
Finally you can create a rollup column that sums the steps through that relation. That will give you a total number of steps for each user/date.

Now if you’re looking to only show the aggragated total for each date, then I would also consider adding a Row ID column to your step table. Using that row id, then create a single relation that links the email/date template back to itself. Create a lookup column the retrieves the Row ID. Finally create an IF column to compare the row’s Row ID to the lookup Row ID. If they match, then return true.  
What this does is only put TRUE on the first row for a user/date. So if they record steps multiple times in one day, only the first instance will have a TRUE, but every user/date row will have their total for the day. This allows you to filter only the TRUE rows, so you don’t see multiple entries per day.

This might cover most of what you want, unless you’re looking for some additional breakdown or summarization of data.
