# User table summary stats from a log data table

**URL:** <https://community.glideapps.com/t/user-table-summary-stats-from-a-log-data-table/58771>\
**Category:** Ask for Help\
**Created:** [March 4, 2023, 6:33pm UTC](https://community.glideapps.com/t/user-table-summary-stats-from-a-log-data-table/58771 "2023-03-04T18:33:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![charlietmail](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/charlietmail/32/55259_2.png) [@charlietmail](https://community.glideapps.com/u/charlietmail)\
**Post date:** [March 4, 2023, 6:33pm UTC](https://community.glideapps.com/t/user-table-summary-stats-from-a-log-data-table/58771/1 "2023-03-04T18:33:52Z")

</div>

I’d like to have some segmented user-level summary stats based on records in a log table.

To illustrate:

 ![log](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/0/30b945003d9a82ae85cd31116efea1649398ec2e.png)

This is the log table. I’d like to have a MAX of [Total] at the level of [Lookup Grade].[Lookup Type], and to put this in my User table.

For example, for user Charlie, the MAX of Grade=1 and Type=6 Count is 200, while for Max it is 275. For Charlie, the MAX of Grade=1 and Type=Navy Seal is 67.

In a spreadsheet I’d use a pivot table and in SQL I’d use GROUP BY. Is there a way to do this conditional / segmented aggregation in the Glide data table?

Thanks for any guidance.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [March 4, 2023, 8:13pm UTC](https://community.glideapps.com/t/user-table-summary-stats-from-a-log-data-table/58771/2 "2023-03-04T20:13:30Z")

</div>

In the Users table, create a multiple relation to this log table. Then, you can use a rollup column in the users table to grab the max value.

The question is, it’s unclear what your relating to in the log table because I don’t see any sort of email or user ID column.

---

<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:** [March 5, 2023, 12:16am UTC](https://community.glideapps.com/t/user-table-summary-stats-from-a-log-data-table/58771/3 "2023-03-05T00:16:19Z")

</div>

Sounds like you’ll need to create a Template column in both tables that joins the user, Grade, and Type together. Then you can use a relation that links those Template values in both tables together, and your Rollup can use the relation bto find the MAX for that specific combination.

---

<div class="post-metadata">

**Author:** ![charlietmail](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/charlietmail/32/55259_2.png) [@charlietmail](https://community.glideapps.com/u/charlietmail)\
**Post date:** [March 5, 2023, 2:19pm UTC](https://community.glideapps.com/t/user-table-summary-stats-from-a-log-data-table/58771/4 "2023-03-05T14:19:13Z")

</div>

@Robert_Petitto - thanks for the reply, and good question! I’d just omitted those columns in my screenshot so that the image was simpler, but there is a User ID field in there:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/7/b71563f4f51caa0294fe4926f5a7a5e9a316f57e.jpeg)

Just to build on your suggestion, using your approach is it also right (as @Jeff_Hager described) that I would need to create a Template field also in the Log table for the relationship? Might be a stupid question, am just in the early days with Glide and appreciate the help!

---

<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:** [March 5, 2023, 2:28pm UTC](https://community.glideapps.com/t/user-table-summary-stats-from-a-log-data-table/58771/5 "2023-03-05T14:28:20Z")

</div>

Relations look for exact matches between the column selected in the source table (Users) and the column selected in the destination table (Log). So, yes, you would need a template column in both tables, and the result of those template columns need to be a value that will match in both tables.

---

<div class="post-metadata">

**Author:** ![charlietmail](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/charlietmail/32/55259_2.png) [@charlietmail](https://community.glideapps.com/u/charlietmail)\
**Post date:** [March 5, 2023, 2:32pm UTC](https://community.glideapps.com/t/user-table-summary-stats-from-a-log-data-table/58771/6 "2023-03-05T14:32:05Z")

</div>

Thanks @Jeff_Hager and @Robert_Petitto

Your advice got me the answer I was looking for:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/c/fc13fbd96c7714963f0dd81cdb4c070df48ddbea.png)

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [March 6, 2023, 2:32pm UTC](https://community.glideapps.com/t/user-table-summary-stats-from-a-log-data-table/58771/7 "2023-03-06T14:32:49Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
