Skip to content

Marks all days in a calendar where you spent more than a money limit (i.e. 75)

Mark all days in a calendar where you spent a certain amount of money

Basic

CALENDAR file.mtime
FROM "20 Dataview Queries"
FLATTEN round(sum(paid)) as SUM
WHERE paid and SUM > 75

bought:: Nike shoes
paid:: 99

bought:: Delicious Cake
paid:: 7

Variants

When using expenses in form of "99 $"

^8d9d50

[!info]
You'll need to go back to Januray/Februrary 2022 to see the data
CALENDAR file.day
FROM "10 Example Data/dailys"
FLATTEN round(sum(map(paid, (x) => number(regexreplace(x, " ?\$", ""))))) as SUM
WHERE paid and SUM > 75
[!tip]
When you try to write complex calendar queries, write a TABLE query first to make sure your query returns the results you're expecting.
TABLE paid, SUM
FROM "10 Example Data/dailys"
FLATTEN round(sum(map(paid, (x) => number(regexreplace(x, "\$", ""))))) as SUM
WHERE paid and SUM > 75