# Aggregate Table (Pivot)

**URL:** <https://connect.superhuman.com/t/aggregate-table-pivot/45893>\
**Category:** Ask the Community\
**Created:** [January 18, 2024, 10:30pm UTC](https://connect.superhuman.com/t/aggregate-table-pivot/45893 "2024-01-18T22:30:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Hubbard](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/ryan_hubbard/32/20028_2.png) [@Ryan\_Hubbard](https://connect.superhuman.com/u/Ryan_Hubbard)\
**Post date:** [January 18, 2024, 10:30pm UTC](https://connect.superhuman.com/t/aggregate-table-pivot/45893/1 "2024-01-18T22:30:13Z")

</div>

I’d like to aggregate a table into a view that only includes the grouped columns and the summed column. For example everyone has hours they add each day by task and I’d like to create a view that is only the total hours a user worked by task like this example.

 ![image](https://global.discourse-cdn.com/coda1/original/3X/2/1/21348f78b3453dbcb6ddf07f1e685cde110fa72f.png)

While I can group the table I can’t have the individual day/hour rows. What’s the best way to do this? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Dan\_Demers](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/dan_demers/32/24226_2.png) [@Dan\_Demers](https://connect.superhuman.com/u/Dan_Demers)\
**Post date:** [January 24, 2024, 5:42pm UTC](https://connect.superhuman.com/t/aggregate-table-pivot/45893/2 "2024-01-24T17:42:21Z")

</div>

Hey @Ryan_Hubbard ,

Great question. In th eWeekly Report table, you will want to create a column for each task, that looks to the lower table and then filters it by the same name. Something like:

`Time Entries.filter(task.containstext(thisrow.task)).time.sum()`

You may have to paly with the containstext, to use that one, or just contains, but that should give you the sum of each task by week. You can do the methodology when creating the name if you want too.

Hopefully that helps!

Best,  
Dan

---

<div class="post-metadata">

**Author:** ![Piet\_Strydom](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/piet_strydom/32/19269_2.png) [@Piet\_Strydom](https://connect.superhuman.com/u/Piet_Strydom)\
**Post date:** [January 24, 2024, 9:56pm UTC](https://connect.superhuman.com/t/aggregate-table-pivot/45893/3 "2024-01-24T21:56:42Z")

</div>

Hi Ryan,

I just happen to be busy working on something that gives a working example of what @Dan_Demers mentioned.

 ![image](https://global.discourse-cdn.com/coda1/original/3X/f/1/f156494a3f00f9b2074886a77dbf129535fabf26.png)

Search for the Meal Planner page in the doc below. I have one table where the meals for a week is recorded, and then the screenshot shows how I list the meals per day and summarise the total calories per day.

> **[Meal Planner · RP's ITE 2.0 - Integrated Thinking Environment](https://coda.io/@piet-strydom/rps-ite-2-0-integrated-thinking-environment/meal-planner-171)**

Regards  
Piet

---

<div class="post-metadata">

**Author:** ![system](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/system/32/24484_2.png) [@system](https://connect.superhuman.com/u/system)\
**Post date:** [January 27, 2024, 9:57pm UTC](https://connect.superhuman.com/t/aggregate-table-pivot/45893/4 "2024-01-27T21:57:42Z")

</div>

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