# Fill empty data when charting running total

**URL:** <https://forum.bubble.io/t/fill-empty-data-when-charting-running-total/294969>\
**Category:** Need help\
**Created:** [November 27, 2023, 5:30am UTC](https://forum.bubble.io/t/fill-empty-data-when-charting-running-total/294969 "2023-11-27T05:30:50Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![hong.michael](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@hong.michael](https://forum.bubble.io/u/hong.michael)\
**Post date:** [November 27, 2023, 5:30am UTC](https://forum.bubble.io/t/fill-empty-data-when-charting-running-total/294969/1 "2023-11-27T05:30:50Z")

</div>

I am trying to chart a running total for a dataset. Georgecollier kindly helped me do this in [this thread.](http://forum.bubble.io/t/how-to-create-running-totals/294916/5)

Problem is this dataset contains holes and i want to plot the holes as well.  
So the end result will show a running total for all dates even the ones with entry. These holes will be calcuated with zeros.

The problem with the solution in the previous thread is that it only plots the dates with entries and cannot plot the holes. Is the only way to do this by actually inputing data for every date?

---

<div class="post-metadata">

**Author:** ![ntabs](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@ntabs](https://forum.bubble.io/u/ntabs)\
**Post date:** [November 27, 2023, 6:36am UTC](https://forum.bubble.io/t/fill-empty-data-when-charting-running-total/294969/2 "2023-11-27T06:36:07Z")

</div>

Not sure how you set it up nor have I looked at the thread you posted but maybe try to include empty parameters? I think you’re only filtering for things that have data in them

---

<div class="post-metadata">

**Author:** ![hong.michael](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@hong.michael](https://forum.bubble.io/u/hong.michael)\
**Post date:** [November 27, 2023, 6:49am UTC](https://forum.bubble.io/t/fill-empty-data-when-charting-running-total/294969/3 "2023-11-27T06:49:42Z")

</div>

Searching for empty parameters won’t work because the database instance doesn’t exist?

---

<div class="post-metadata">

**Author:** ![georgecollier](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/georgecollier/32/182327_2.png) [@georgecollier](https://forum.bubble.io/u/georgecollier)\
**Post date:** [November 27, 2023, 9:06am UTC](https://forum.bubble.io/t/fill-empty-data-when-charting-running-total/294969/4 "2023-11-27T09:06:24Z")

</div>

I’m not at my computer but the solution here lies somewhere in having a format as text yes/no condition that when a number is zero we do something else. I think my solution has an issue which is that it could break with zeros because of duplicate number in the list. I don’t know, I’ll test maybe.

---

<div class="post-metadata">

**Author:** ![georgecollier](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/georgecollier/32/182327_2.png) [@georgecollier](https://forum.bubble.io/u/georgecollier)\
**Post date:** [November 27, 2023, 7:58pm UTC](https://forum.bubble.io/t/fill-empty-data-when-charting-running-total/294969/5 "2023-11-27T19:58:22Z")

</div>

> [@georgecollier](#):
>
> I think my solution has an issue which is that it could break with zeros because of duplicate number in the list

I checked and it works fine:

 ![CleanShot 2023-11-27 at 20.57.31@2x](https://us1.discourse-cdn.com/bubble/original/3X/6/d/6d19ecd5bc864dec3614fdc4f3499605f63aefbb.png)

To not skip empty dates, you need to be Do a search for Data Type:grouped by Date (do not skip empty groups). Rest of the logic is the same (grouping’s aggregation number can be used in the cumulative sum logic)

---

<div class="post-metadata">

**Author:** ![hong.michael](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@hong.michael](https://forum.bubble.io/u/hong.michael)\
**Post date:** [November 28, 2023, 2:41am UTC](https://forum.bubble.io/t/fill-empty-data-when-charting-running-total/294969/6 "2023-11-28T02:41:59Z")

</div>

Ok I tried grouping every list call but not getting the correct results. The running total is not correct for the zeros. I think the problem is the format to text and extract with regex because I no longer can input the current cells unique ID. Instead I can only input the groupings aggregation.

Could you maybe post a demo editor so I can see your logic with the groupings?

 ![Screenshot 2023-11-28 at 11.43.18 AM](https://us1.discourse-cdn.com/bubble/original/3X/6/6/66c82cbd0f7f2383df29bf87aca72ccef7b9ee75.png)  
 ![Screenshot 2023-11-28 at 11.43.31 AM](https://us1.discourse-cdn.com/bubble/original/3X/4/6/463947c58c31cd44692ac032410f76b32d2402e5.png)  
 ![Screenshot 2023-11-28 at 11.43.44 AM](https://us1.discourse-cdn.com/bubble/original/3X/e/d/ed81774600589766444b8ae8804b7710c00186b2.png)  
 ![Screenshot 2023-11-28 at 11.58.36 AM](https://us1.discourse-cdn.com/bubble/original/3X/a/5/a514c33069286d4efdb107d0dd43a963fbecd6ee.png)

---

<div class="post-metadata">

**Author:** ![hong.michael](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@hong.michael](https://forum.bubble.io/u/hong.michael)\
**Post date:** [November 28, 2023, 3:12am UTC](https://forum.bubble.io/t/fill-empty-data-when-charting-running-total/294969/7 "2023-11-28T03:12:59Z")

</div>

Never mind. I got it to work. Thanks so much.

---

<div class="post-metadata">

**Author:** ![hong.michael](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@hong.michael](https://forum.bubble.io/u/hong.michael)\
**Post date:** [November 28, 2023, 6:27am UTC](https://forum.bubble.io/t/fill-empty-data-when-charting-running-total/294969/8 "2023-11-28T06:27:30Z")

</div>

Actually, there is a problem. So the running total with empty spaces works. but the problem is that for some reason the aggregates are pushed back in date randomly. So the running total for the first data comes 7days earlier while the last data is pushed back as much as a month.

Update:

So I figured out the reason. The counter using the regex you made was giving multiples of 2 so needed to divide by 2. The reason for this is beyond me. Could you explain?

---

<div class="post-metadata">

**Author:** ![georgecollier](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/georgecollier/32/182327_2.png) [@georgecollier](https://forum.bubble.io/u/georgecollier)\
**Post date:** [November 28, 2023, 9:00am UTC](https://forum.bubble.io/t/fill-empty-data-when-charting-running-total/294969/9 "2023-11-28T09:00:56Z")

</div>

That’s not the reason for your issue. The regex is supposed to extract a unique ID. It then counts the number of commas before that unique ID to work out the item # in the list. You can find a way to make each grouping have a unique ID (e.g display the grouping’s data’s unique IDs in a concatenated list)

---

<div class="post-metadata">

**Author:** ![hong.michael](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@hong.michael](https://forum.bubble.io/u/hong.michael)\
**Post date:** [November 28, 2023, 9:03am UTC](https://forum.bubble.io/t/fill-empty-data-when-charting-running-total/294969/10 "2023-11-28T09:03:06Z")

</div>

how do you get a unique ID for a grouping? I only see aggregates or grouping fields?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [February 5, 2024, 5:31am UTC](https://forum.bubble.io/t/fill-empty-data-when-charting-running-total/294969/11 "2024-02-05T05:31:27Z")

</div>

Closed on February 5, 2024, 5:31am UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
