I’ve been messing around with the sum() function but everytime I try, I break the table I’ve created.
I am attempted to track my spending in a rapid log format in my daily notes. In other words, I’m hoping to just type something along the lines of “Spending:: Starbucks - 10” into my daily notes rapid log, and then use Dataview to compile that information later.
So, for example, a given day’s rapid log may look like this:
- Spending:: Bought tights, a card for Anna, and gift bags at Duane Reade - 23.48
- Spending:: Corner store - 2.50
- Breakfast:: Coffee and a croissant
- PG/Chancel choir sang
- Spending:: Offering - 30.00
- Helped Gelilah with her tech stuff.
- Spending:: Dinner at The Row with Anna - 54.75
- Lunch:: Shrimp and Grits
- Watered Shannon’s plants.
- Spending:: Starbucks Coffee Reload - 10.00
- Starbucks Coffee Reload - 10.00
- Spending:: Moving Boxes - 117.00
- Dinner:: Leftover Bua Thai Phuket noodles.
- IWatched:: [[Euphoria]]
I’ve gotten so far as making a table that displays my spending for that day using this query:
TABLE WITHOUT ID file.link as Date, split(Spending, " - ") as Where, split(Spending, " - ") as Amount, TotalSpending as Total FROM "Diary/Daily Notes" FLATTEN Spending WHERE file.name = this.file.name
Table looks like this:
Where I’m getting stuck is I would like to either (A) create a running total in the total column so the last row displays the total amount spent that day, or (B) just create an inline query that displays the total spending for that day.
I thought I could do this using the sum() function, but my tables break every time I attempt it. I’m assuming I’m not using the best methodology to achieve what I’m aiming to achieve.
Does anyone have any thoughts or ideas on how I can better accomplish this?
Thanks in advance!