Statistics are the numbers Trac computes about your holdings — things like a holding’s value, its income over the last twelve months, or its rate of return. Trac ships a catalog of built-in statistics, and you can also define your own custom statistics with a formula. This page covers what statistics are, how to manage the catalog, how to add or edit a custom one, and how statistics show up around the app.
Built-in vs. custom statistics#
Every portfolio starts with a catalog of built-in statistics — the standard portfolio measures (value, cost basis, income, gain, return, and so on). These are maintained by Trac and are ready to use without any setup.
On top of the built-ins, you can create custom statistics that are scoped to your portfolio. A custom statistic is defined by a formula you write, so you can measure things that matter specifically to you (for example, a fee ratio or a cash-drag figure) that aren’t in the built-in set.
In lists and pickers, built-in statistics are tagged built-in and your own are tagged custom, so you can always tell them apart. Built-ins and customs sit together in one merged catalog — your customs appear alongside the standard measures everywhere a statistic can be chosen.
The statistics catalog#
You manage the catalog from Configurations → Statistics. This is a single, searchable list of every statistic available to your portfolio — your custom statistics on top, then the built-ins, sorted by name.
Each row shows the statistic’s name, an optional description, a built-in/custom tag, and the formula that defines it (rendered as a small code block).
A few things help you find what you want:
- Search. Type in the search box to filter the list by name, description, or formula text. Search looks across both built-ins and customs.
- Show / hide defaults. Built-in statistics are hidden by default so your own customs are front and center. Tap Show N Defaults to reveal the built-in catalog, and Hide to collapse it again. (When you’re searching, built-ins always show so you can find anything by name.)
From this list you can:
- Tap a row to open it for editing.
- Tap the + button (top right) to create a new custom statistic.
Add a custom statistic#
To create a statistic, open Configurations → Statistics and tap the + button. The Add Statistic form opens with these fields:
- Key — the internal identifier for the statistic. It is filled in for you automatically from the name (lowercased, with spaces turned into underscores) and is read-only, so you never have to set it by hand.
- Name — what the statistic is called. This is what you’ll see in lists and pickers. (Required.)
- Description — an optional sentence explaining what the statistic measures.
- Format — how the result is displayed. Choose one of Currency,
Number, Percent, Factor (a multiple, e.g.
1.25x), or Date. New statistics default to Currency. - Dimension — whether the statistic is measured at a single point in time or
over a window of time:
- Point in Time — a snapshot value as of a date (for example, current value).
- Period — a value measured over a window. Period statistics let you choose which window to view (such as trailing 12 months or year-to-date) wherever the statistic is shown.
- Formula — the expression that computes the statistic, written in Trac’s formula language (see Writing a formula below). (Required.)
Below the formula, a preview shows how the result will be formatted with the format you picked.
When you’re done, save the form. Saving happens in the background and your new statistic immediately joins the catalog and every statistic picker. As with other forms in Trac, the Name and Formula are required — if either is empty, Trac keeps the form open and tells you what’s missing.
Writing a formula#
A statistic’s formula is written in Trac’s small formula language. You don’t have to memorize it — the formula editor helps you as you type:
- As you type a name, a suggestions panel lists matching building blocks — data accessors (like a holding’s value), math functions, and other statistics you can reference.
- Each suggestion shows its signature, and a ? expands inline help with a short description and an example.
- Tapping a suggestion inserts it at your cursor.
- If the formula has a mistake, the editor shows the parse error (with the column) right below the input, so you can fix it before saving.
Formulas can reference:
- A holding’s own data — for example, its value or cost basis.
- Other statistics — you can build a statistic out of other statistics (for example, dividing one by another to get a ratio). A statistic can’t reference itself.
- Account roles and accounts — the chart-of-accounts roles and accounts on your portfolio, which the editor offers as suggestions while you type.
If you’d rather describe what you want in plain English, tap Ask Traci on the form. This opens a chat with Trac’s assistant, pre-filled with context about the statistic you’re working on, and Traci can help you write or refine the formula.
Edit, duplicate, delete, and revert#
Open a statistic from the catalog (or from the stat inspector — see below) to edit it. What you can do depends on whether it’s a custom statistic or a built-in.
For a custom statistic, the edit form offers:
- Save — apply your changes.
- Duplicate — start a new statistic pre-filled from this one (with " Copy" added to the name), so you can tweak and save it as a separate stat.
- Delete — remove the custom statistic. This asks you to confirm first and cannot be undone.
- Ask Traci — get help adjusting the formula.
For a built-in statistic, you can customize it: editing a built-in saves your changes as a portfolio-specific override on top of the standard definition. The original is never lost. A customized built-in shows a Revert to default button — tap it (and confirm) to discard your customization and return to Trac’s standard version. Built-ins can’t be deleted; reverting is the way to undo a customization.
Where statistics show up#
Statistics appear on a holding’s detail screen, in a statistics card that lists the statistics you’ve chosen for that holding.
- Choosing which statistics to show. From the statistics card you can pick which statistics appear. For period statistics, you also choose which time windows to show (such as trailing 12 months, year-to-date, or a prior year), and each chosen window appears as its own line.
- The stat inspector. Tap a statistic’s value to open the inspector,
which shows exactly how that number was computed:
- The Formula — the statistic’s definition.
- The Values — the same formula with each piece replaced by the actual
number it resolved to, ending in
=the final answer. This makes it easy to see which inputs drove the result. - Drill in. In the Values view, an amount that comes from underlying records is tappable — tap it to open the source postings behind that figure. If the formula references another statistic, you can tap that piece to open a nested inspector for the sub-statistic.
- Edit from here. The inspector has a pencil (edit) action that opens the statistic’s form, so you can adjust a definition right after inspecting a value.
Custom statistics can also be added as columns in the Explorer on the Portfolio Items tile, alongside built-in statistics and holding fields — see Explorer for how to add custom columns.