stats
Dashy vault/Reference/stats
Reference/stats.md

stats: the numbers

Properties
code block
stats
keys
2 on the block, 19 on each card
checked on
Dashy 1.5.2

Number cards: one value per card, computed over a selection of notes.

From the demo vault

stats
```stats
columns: 4
items:
  - { label: Days logged, source: Diary, agg: count, icon: 📔 }
  - { label: Average sleep, source: Diary, field: sleep_score, agg: avg, precision: 1, trend: 30d }
  - { label: Steps this week, source: Diary, field: steps, agg: sum, unit: steps, period: week }
  - { label: Best night, source: Diary, field: sleep_score, agg: max, trend: 90d }
  - { label: Longest streak, source: Diary, field: sleep_score, agg: streak, unit: days }
  - { label: Latest steps, source: Diary, field: steps, agg: latest, sub: most recent note }
  - { label: Great nights, source: Diary, where: "sleep_score >= 90", agg: count }
  - { label: Books read, source: Books, period: year, date_field: finished, agg: count, icon: 📚 }
```
renders as
Eight number cards: counts, an average, sums, a maximum, a streak, two with sparklines

A minimal block

The shortest config worth pasting. Change the folder and the property names to yours.

stats
```stats
columns: 3
items:
  - { label: Notes, source: 01-Areas, agg: count }
  - { label: Sleep, source: Diary, field: sleep_score, agg: avg, precision: 1, trend: 30d }
  - { label: Best streak, source: Diary, field: sleep_score, agg: streak }
  - { label: Gym this week, source: Diary, field: gym, agg: sum, period: week, compare: true, better: up }
```

Keys on the block

KeyWhat it doesTypeDefault
columns columns in the grid, 1 to 6 number 3
items required the list of cards list none

Keys on each card

Each entry under items is one card.

KeyWhat it doesTypeDefault
label requiredalso title, name caption under the number text none
sourcealso folder, from folder; includes nested ones text none
tag tag, with or without the hash text none
where a condition like year = 2026, rating >= 4, tags contains books, or several that must all hold: joined with and (year = 2026 and rating >= 4) or written as a list ([year = 2026, "rating >= 4"]). The field name may be a dotted path into a nested property, like health.sleep > 70. or is not supported; quote a value holding the word and or or. One unreadable condition drops the whole filter with a warning, and the numbers are drawn unfiltered text or list none
period narrow to a window ending today: week, month, year (the current calendar one) or a rolling count of days like 30d. Notes without a date are left out first, then every agg, count included, runs on what remains. A week starts on the first day of the interface language, Dashy's own when one is picked in its settings, otherwise Obsidian's: Sunday in English, Monday in most European languages text or number none
date_field a date frontmatter property to read instead of the note name: 2026-03-02 or 2026-03-02T10:30, or a dotted path into a nested property like meta.date. Feeds period's window and the streak, current_streak, latest and trend readings; has no effect on count, sum, avg, min or max without period text none
compare show the delta against the same stretch of the previous period, to date: this week compares against the same weekdays last week, not the whole of last week. Only with period set, and not with agg: streak or current_streak true or false none
better up colours a rise green and a fall red; down reverses that for a number where less is better. No change stays neutral either way. Only with compare: true text none
fieldalso property, prop numeric frontmatter property, or a checkbox (ticked counts as 1, unticked as 0), dotted for a nested one like health.sleep; required for everything but count, streak and current_streak. A field missing from the whole selection, or holding text rather than a number, shows a dash and a warning naming it; count text instead with where: "field contains ..." and agg: count. A duration string like 5h 58min, 1h30m, 45m, 90 min or 7:30 counts as minutes, and sum, avg, min, max or latest over a field of durations shows 5h 58m; H:MM is always a duration, never a time of day. A field mixing durations and plain numbers counts both as minutes, shows a plain number and warns naming a note of each kind text none
aggalso aggregate count sum avg min max latest streak current_streak text count
at_least with agg: streak or current_streak only: a day counts only once its notes' field values, summed for that day, reach this, like at_least: 5000 steps; combine with at_most for a range. Needs field; ignored on any other aggregate. Takes a duration like 7h or 7:30 too, read as minutes; a plain number against a field of durations means minutes number or text none
at_most with agg: streak or current_streak only: a day counts only while its notes' field values, summed for that day, stay at or under this, like at_most: 5 cigarettes; combine with at_least for a range. Needs field; ignored on any other aggregate. Takes a duration like 7h or 7:30 too, read as minutes; a plain number against a field of durations means minutes number or text none
days with agg: streak or current_streak only: weekdays makes Saturday and Sunday transparent, so they neither break the run nor add to it, whatever they hold; all, the default, counts every day. Ignored on any other aggregate text all
skip_field with agg: streak or current_streak only: a property marking a day special, like vacation: true or sick: flu; a day is special once any note landing on it sets the property to anything other than false, a blank string, 0 or absent. A special day neither breaks the run nor adds to it, whatever field holds, the same way days: weekdays treats a weekend, and the two combine. Ignored on any other aggregate text none
unit a suffix after the number: km, %, d. Ignored, with a warning, on a value shown as a duration, which carries its own units. text none
precision decimal places, 0 to 6; by default a whole number stays whole and a fraction gets one decimal; no effect on a value shown as a duration number none
trend sketch the last N days ending today: 30d. Needs field. Its own trailing window, independent of period text or number none
iconalso emoji emoji text none
sub small caption under the title text none

How it behaves

  • streak counts the longest run of consecutive days and latest takes the value from the newest note, a tie on the same date broken by path. Both resolve a note's date the same way period does, below, and two or more notes landing on the same day count as one day. With a field: set, streak is a field aggregate like sum or avg: nothing to count shows a dash, even over an empty selection. Without a field: it counts every selected note's own date instead, and reads a plain 0 when there is nothing, the same as count. streak is the best run on record: label the card "Best streak" or "Longest streak". current_streak is the run going on now, counted back from today by the same rules: label the card "Current streak" or "Days in a row". Today never breaks it: a day not filled yet leaves the run counted up to yesterday, and only a gap on yesterday or earlier resets it to 0. It counts within the selection after period, where, tag and source, so period: month stops it at the first of the month.
  • count over nothing reads a plain 0, the number of notes found; every other aggregate, and streak or current_streak with a field set, shows a dash instead: "no data" and "zero" are different answers.
  • trend sketches the days of a trailing window ending today, scaled between the smallest and largest value in that window rather than from zero. A day without a note is left out, not drawn as a zero, and two or more notes on the same day are summed into that one day's bar.
  • period narrows to a calendar week, month, year or a rolling Nd, always ending today. A note's date is its name, as long as it starts with YYYY-MM-DD (2026-03-02 Monday counts, 2026-03-021 does not), unless date_field names a property instead; a note with no date under either rule is left out before counting.
  • compare needs a note in both windows; when either the current or the previous stretch has none at all, the card shows its number alone with no delta. streak and current_streak have no value of their own to compare and refuse compare outright, the way trend refuses count.
  • at_least/at_most turn streak into a threshold: a day counts only when its notes' field values, summed for that day, satisfy the bound, at_least: 5000 on steps for example. days: weekdays makes Saturday and Sunday transparent for streak and current_streak: they neither break the run nor extend it, whatever they hold, so a Friday followed by a Monday is a run of two. skip_field does the same for a day any note marks special, vacation: true or sick: flu for example, and combines with days: weekdays. All three keys apply to agg: streak and agg: current_streak only and are ignored on every other aggregate.