# Issues aggregating values by date from another table

**URL:** <https://connect.superhuman.com/t/issues-aggregating-values-by-date-from-another-table/38373>\
**Category:** Ask the Community\
**Created:** [March 13, 2023, 10:48am UTC](https://connect.superhuman.com/t/issues-aggregating-values-by-date-from-another-table/38373 "2023-03-13T10:48:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pablo\_DV](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/pablo_dv/32/49028_2.png) [@Pablo\_DV](https://connect.superhuman.com/u/Pablo_DV)\
**Post date:** [March 13, 2023, 10:48am UTC](https://connect.superhuman.com/t/issues-aggregating-values-by-date-from-another-table/38373/1 "2023-03-13T10:48:29Z")

</div>

Hello everyone,

I have a doc where I want to log the history of different items over time, and then viualize the evolution of some of their meta data aggregated per day.

I have a button that for each item it creates a row in a history table, where the current date and other values related to the item are stored.

There is another table with a row per day, where the values from the items are aggregated.

When the button is pressed, the history is generated correctly, but the aggregated values don’t appear in the other table until I manually overwrite the dates manually.

 ![image](https://global.discourse-cdn.com/coda1/original/3X/4/6/467e74d2fac4162a09bbbc9fab4b079c694d806d.png)  
 ![image](https://global.discourse-cdn.com/coda1/original/3X/6/4/643c5736c9d94284c86aa5fc99a8fb74875569fa.png)

After manually selecting the date it works

 ![image](https://global.discourse-cdn.com/coda1/original/3X/5/a/5ac286384f92a66fbdfdbc1b17b2d7b5823a5646.png)  
 ![image](https://global.discourse-cdn.com/coda1/original/3X/5/5/55b0b72825c1ca727825304830c3a2e7349540a5.png)

Does anybody know why does this happen?

You can see my issue in the following sample doc clicking the button in the ‘Aggregated Data’ page:

https://coda.io/embed/NA9KAQRwoj?viewMode=embed

Thank you very much in advance!

Pablo

---

<div class="post-metadata">

**Author:** ![Pch](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/pch/32/17688_2.png) [@Pch](https://connect.superhuman.com/u/Pch)\
**Post date:** [March 13, 2023, 11:44am UTC](https://connect.superhuman.com/t/issues-aggregating-values-by-date-from-another-table/38373/2 "2023-03-13T11:44:21Z")

</div>

Hi @Pablo_DV 😊 !

It seems like the culprit is your `Now()` in your button 😊

`Now()` always output a `Date/Time` value (the precision here is to the seconds).

In your button, you use it to create an apparent date in your table `[Issue History]`.  
But if you display `Now()` in a `Date` field, the time part will still be there, hidden behind the scene.

So, in your table `[Aggregated Data]`, you’re not exactly comparing a date to a date but a date/time (with a certain set of hours, minutes and seconds behind the scene) to another date/time (where the time part would be set to midnight, as it’s the default time value for a date) both displayed as a dates… which is only corrected when you edit the field 😊 … or vice-versa 😇 .

My point here being that there seem to be a mismatch between the values in the `Date` field in your table `[Issue History]` and the `Date` field in your table `[Aggregated Data]` which most likely comes from `Now()` 😊

Depending on how important `Now()` is in your setup, you could use `Now("day")` (which is the equivalent to `Today()`… I’ve talked a little bit about this recently, [in this topic](https://connect.superhuman.com/t/reformat-date-and-time-with-now/38113/7) 😊 )

… or in your `Filter()` in the duration field `Reported`, you could round your `CurrentValue.date` to the `day` unit using [DateTimeTruncate()](https://coda.io/formulas#DateTimeTruncate) .

```plaintext
[Issue History].Filter(
  Date.DateTimeTruncate("day") = thisRow.Date).Reported.Sum().WithName(
  S,
  If(S = 0,"",S)
 )

```

I hope this helps 😇

---

<div class="post-metadata">

**Author:** ![Pablo\_DV](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/pablo_dv/32/49028_2.png) [@Pablo\_DV](https://connect.superhuman.com/u/Pablo_DV)\
**Post date:** [March 13, 2023, 1:06pm UTC](https://connect.superhuman.com/t/issues-aggregating-values-by-date-from-another-table/38373/3 "2023-03-13T13:06:27Z")

</div>

It works perfectly now, thank you very much @Pch !!

---

<div class="post-metadata">

**Author:** ![Pch](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/pch/32/17688_2.png) [@Pch](https://connect.superhuman.com/u/Pch)\
**Post date:** [March 13, 2023, 1:12pm UTC](https://connect.superhuman.com/t/issues-aggregating-values-by-date-from-another-table/38373/4 "2023-03-13T13:12:49Z")

</div>

My pleasure @Pablo_DV 😁 !

I’m very glad to know this now works as expected 🙌 !

---

<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:** [March 16, 2023, 1:13pm UTC](https://connect.superhuman.com/t/issues-aggregating-values-by-date-from-another-table/38373/5 "2023-03-16T13:13:16Z")

</div>

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