Slash-actions: sum and average your variables in one keystroke
You’ve been building up a column of numbers — expenses, hours, scores — and now you want the total. CalNote can already do it, but you had to retype every variable name yourself. Not anymore. Start a line with / and an actions popover opens, the same way the variable and unit suggestions do. The first two actions, /sumAbove and /avgAbove, fold every variable declared above the line into a single expression.
The important part: they expand to a live expression built from the variable names, not a frozen number. Change any input and the total recomputes — exactly like a formula you’d have typed by hand.
/sumAbove — add up everything above
Type / on a fresh line, pick /sumAbove, and it becomes an add-chain of every variable declared above it. Here’s what that expansion looks like once accepted:
The last line is what /sumAbove writes for you. Because it references the names — not the values — editing groceries to 260 reflows the total instantly. Add a fifth variable above and re-run the action to fold it in.
/avgAbove — the mean, wrapped and divided
/avgAbove follows the same idea but wraps the sum in parentheses and divides by the count:
(jan + feb + mar) / 3 is generated from the three variables above. Divide-by-nothing is handled — with no variables above, both actions fall back to a plain 0 instead of erroring.
Only real assignments count. Headings (# Q1), comments (// draft), and the reserved now keyword are skipped, so a section title between your numbers won’t sneak into the sum.
Right-click a selection: Sum / Average selected
Sometimes you don’t want everything above — just a handful of lines. Select two or more variable assignments, right-click, and the context menu offers Σ Sum selected and ÷ Average selected (each with a “N vars” hint). Picking one inserts the expression on a new line directly below the selection:
Highlight q1 through q4, choose Sum selected, and CalNote drops in q1 + q2 + q3 + q4 (= 20400) below them. Average selected would insert (q1 + q2 + q3 + q4) / 4 instead. It’s the same live-expression trick as the slash-actions, scoped to exactly the lines you picked — handy when a board has several groups of numbers and you only want to total one of them.
Where to find them
- Slash commands open on
/at the start of any line — same keyboard flow (↑/↓, Enter or Tab to accept, Esc to dismiss) as every other CalNote suggestion. - Right-click actions appear only when a multi-line selection contains 2+ variables.
- Both are documented in the Actions section of the Help modal (press
?), listed right under Units.
A left-behind, un-accepted /sumAbove line just renders dimmed with no result — no red error — so a half-typed command never breaks the board.
Slash-actions turn the tedious part of a running tally into a single keystroke. Open app.calnote.eu, stack a few variables, and type / on the next line. Like everything else in CalNote, it works offline and never leaves your browser.