farseer-cli 1.20.0 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +1 -1
  2. package/dist/commands/dimensions.js +20 -4
  3. package/dist/commands/dimensions.js.map +1 -1
  4. package/dist/commands/sheets.js +200 -15
  5. package/dist/commands/sheets.js.map +1 -1
  6. package/dist/index.js +10 -1
  7. package/dist/index.js.map +1 -1
  8. package/dist/mcp/tools/modelTools.js +17 -6
  9. package/dist/mcp/tools/modelTools.js.map +1 -1
  10. package/dist/operations/model.js +6 -2
  11. package/dist/operations/model.js.map +1 -1
  12. package/dist/operations/sheets.js +368 -30
  13. package/dist/operations/sheets.js.map +1 -1
  14. package/dist/pipeline/generated-reference.json +10 -10
  15. package/dist/utils/dimensionMembers.js +54 -0
  16. package/dist/utils/dimensionMembers.js.map +6 -0
  17. package/dist/utils/entityResolver.js +2 -0
  18. package/dist/utils/entityResolver.js.map +1 -1
  19. package/docs/cli-guide.md +17 -3
  20. package/docs/pipeline-reference.md +126 -18
  21. package/package.json +2 -2
  22. package/skills/farseer-dashboards/SKILL.md +222 -20
  23. package/skills/farseer-dashboards/cards.md +59 -0
  24. package/skills/farseer-dashboards/charts.md +245 -0
  25. package/skills/farseer-dashboards/check.md +91 -0
  26. package/skills/farseer-dashboards/measures.md +88 -0
  27. package/skills/farseer-dashboards/page.md +99 -0
  28. package/skills/farseer-dashboards/reporting-period.md +82 -0
  29. package/skills/farseer-dashboards/standard-set.md +182 -0
  30. package/skills/farseer-dashboards/tables.md +174 -0
  31. package/skills/farseer-data-permissions/SKILL.md +85 -0
  32. package/skills/pipeline-authoring/SKILL.md +3 -3
  33. package/skills/pipeline-authoring/practices.md +2 -1
@@ -0,0 +1,245 @@
1
+ # Charts
2
+
3
+ The chart blocks, each with its lines and its visualization. Keys are written `<line name>` (SKILL.md §3.2); colours are the Acme ones, so put in your AC colour and its tints (SKILL.md §2.1). Every chart below has `"columnVisualizationByPath": {}` and sits in a tile whose style is `{"showBackground": false, "hasShadow": false, "showBorder": false, "showFootnotes": true}`.
4
+
5
+ `GROUP` stands for a shared-axis group number: one per chart block on the page (SKILL.md §2.6). Two number formats stand in by name: `KEUR0` is `{"type": "NUMBER", "unit": "THOUSANDS", "negatives": "SIGNED", "polarity": "POSITIVE", "currency": "EUR", "decimals": 0, "formatString": "#,##0,", "custom": false}`, and `KEUR0_EXPLICIT` the same with `"negatives": "EXPLICIT"` and `"formatString": "+#,##0,;-#,##0,;0,"`.
6
+
7
+ Contents: §1 monthly scenario chart with variance tiers, §2 categorical comparison, §3 composition, §4 cash over time, §5 structure 100 %, §6 small multiples, §7 rules for every chart.
8
+
9
+ ## 1. Monthly scenario chart with variance tiers
10
+
11
+ "How does net sales run over the year against plan?" Three tiles stacked in one w18 column, top to bottom: ΔPL % h6, ΔPL h5, the base chart h8. A single base chart without tiers is h10. The tiers are the point of the chart: a base chart without them answers a different question.
12
+
13
+ All three ignore the dashboard filters (`useDashboardFilters: false`) and always show the whole year; the footnote of the base chart says so.
14
+
15
+ **Base chart**, rows in this order. A later row is drawn over an earlier one, so PL comes first and sits behind; AC and FC stack because both are `STACKED_BAR_CHART` rows:
16
+
17
+ | Line | Variable | Members |
18
+ | --- | --- | --- |
19
+ | row `PL` | Net sales | plan version, `Reporting period=Current year` |
20
+ | row `AC` | Net sales by closed month | `Versions=Actual`, `Reporting period=Current year` |
21
+ | row `FC` | Net sales by open month | `Reporting period=Current forecast`, `Reporting period=Current year` |
22
+ | row `PY` | Net sales | `Versions=Actual`, `Reporting period=Prior year` |
23
+ | the 12 months (SKILL.md §3.1) | | |
24
+
25
+ ```json
26
+ {"type": "CHART", "chart": {"type": "COMBO_CHART", "layout": "HORIZONTAL",
27
+ "labels": {"showLabels": true, "labelAlign": "END", "labelFormat": {"type": "NUMBER", "unit": "THOUSANDS", "negatives": "SIGNED", "polarity": "POSITIVE", "currency": "EUR", "decimals": 0, "formatString": "#,##0,", "custom": false}},
28
+ "spacing": {"barSpacing": -60, "marginRight": 20},
29
+ "display": {"showValueAxis": false, "showDomainAxis": true, "showLegend": false, "showIntegratedLegend": false, "domainAxisColor": "#020810", "shareAxis": true, "shareAxisGroup": GROUP},
30
+ "series": {"groupByDepth": false, "transposeData": false, "keepEmptyValue": true, "keepEmptyDomain": false},
31
+ "rowVisualizationByPath": {
32
+ "<PL>-0": {"color": {"solid": "#3B2A47", "border": "#3B2A47", "borderStyle": "THIN", "colorBy": "STATIC", "pattern": "NONE"}, "labels": {"showLabels": false}},
33
+ "<AC>-0": {"type": "STACKED_BAR_CHART", "color": {"solid": "#3B2A47", "colorBy": "STATIC", "pattern": "SOLID"}, "labels": {"showLabels": true, "labelAlign": "END", "labelFormat": KEUR0}},
34
+ "<FC>-0": {"type": "STACKED_BAR_CHART", "color": {"solid": "#3B2A47", "border": "#3B2A47", "borderStyle": "THIN", "colorBy": "STATIC", "pattern": "HATCHED"}, "labels": {"showLabels": true, "labelAlign": "END", "labelFormat": KEUR0}},
35
+ "<PY>-0": {"type": "INDICATOR_CHART", "color": {"solid": "#A597B1", "colorBy": "STATIC", "pattern": "SOLID"}, "labels": {"showLabels": false}}},
36
+ "columnVisualizationByPath": {}}}
37
+ ```
38
+
39
+ Footnote: "AC solid to the last closed month, FC hatched after, outline PL, triangle PY. Ignores the filters."
40
+
41
+ **ΔPL tier**, two rows with the half-unit guard built in ([`measures.md`](measures.md) §2):
42
+
43
+ | Line | Variable | Members |
44
+ | --- | --- | --- |
45
+ | row `ΔPL` | Net sales ΔPL by closed month | `Reporting period=Current year` |
46
+ | row `ΔPL FC` | Net sales ΔPL by open month | `Reporting period=Current year` |
47
+ | 12 month columns | | |
48
+
49
+ ```json
50
+ {"type": "CHART", "chart": {"type": "BAR_CHART", "layout": "HORIZONTAL",
51
+ "labels": {"showLabels": true, "labelAlign": "AUTO", "labelFormat": {"type": "NUMBER", "unit": "THOUSANDS", "negatives": "EXPLICIT", "polarity": "POSITIVE", "currency": "EUR", "decimals": 0, "formatString": "+#,##0,;-#,##0,;0,", "custom": false}},
52
+ "spacing": {"marginTop": 22, "barSpacing": 0, "marginRight": 20, "marginBottom": 14},
53
+ "display": {"showValueAxis": false, "showDomainAxis": false, "showLegend": false, "showIntegratedLegend": false, "domainAxisColor": "#020810", "domainAxisBorderStyle": "DOUBLE", "shareAxis": true, "shareAxisGroup": GROUP},
54
+ "series": {"groupByDepth": false, "transposeData": false, "keepEmptyValue": true, "keepEmptyDomain": true},
55
+ "rowVisualizationByPath": {
56
+ "<ΔPL>-0": {"color": {"solid": "#3B2A47", "positive": "#0CB955", "negative": "#E21E09", "colorBy": "VALUE", "pattern": "SOLID"}, "labels": {"labelFormat": KEUR0_EXPLICIT}},
57
+ "<ΔPL FC>-0": {"color": {"solid": "#3B2A47", "positive": "#0CB955", "negative": "#E21E09", "border": "#020810", "borderStyle": "THIN", "colorBy": "VALUE", "pattern": "HATCHED"}, "labels": {"labelFormat": KEUR0_EXPLICIT}}},
58
+ "columnVisualizationByPath": {}}}
59
+ ```
60
+
61
+ The ΔPL tier and the base share one scale (the same `shareAxisGroup`). **ΔPL % tier**: the same with `"type": "PIN_CHART"`, the rows reading the ΔPL % measures, the percentage format of SKILL.md §2.5, `"marginTop": 26`, and no `shareAxis`.
62
+
63
+ - **Tier labels** in whole units (`#,##0,` for kEUR); one decimal collides on w18 and hides labels.
64
+ - **Empty months stay.** `keepEmptyValue: true` on the base and every tier, or a tier with values in a few months spreads them over the width and its bars stop lining up with the months below. `keepEmptyDomain` is a different switch: it keeps a whole series without values.
65
+ - **A % tier on a result** (EBITDA, EBIT, net profit) only when its plan is positive in every month and the smallest month is at least 10 % of the monthly average; otherwise the chart has the ΔPL tier and the base only. Revenue and costs always keep it. Balances (cash, working capital, net debt) and FTE take the ΔPL tier only, neutral unless the company's report gives them a direction. Every % variance on a tier is blank where |Δ%| > 100 %, and the base chart's footnote says so. The tiers themselves have no footnote.
66
+ - **Side by side**, two charts line up their base charts: when only one has a % tier, move the other down by the tier's height.
67
+ - **When the variance is a few % of the base** (headcount), the shared scale makes the tier very thin: drop it to h4 and give the base h10.
68
+ - **Against PY** (no plan, or a "better than last year?" chart): no PL row, and the PY row comes first, then AC and FC, so PY is a solid column in the PY tint drawn behind AC (the `-60` bar spacing, no `type` override). No triangle; the tiers read the ΔPY measures with the axis `THICK` in the PY tint.
69
+ - **The PY triangle with PL on the chart**: when one PY month is more than about twice the AC and PL range, drop the PY row on that chart (PY stays in the table) and say so.
70
+ - **One chart outside a set**, on a model without `Reporting period`: don't build the month-end close for it. Name the year on the lines (`Years=Y2026`), read AC as the plain variable on `Versions=Actual`, and FC, when a forecast exists, as a measure blank where Actual has data. The measures, all with the guards of [`measures.md`](measures.md) §3:
71
+ - `<X> FC where no actual` = `if(not(hasValue(sum(<X>, "Versions">"Actual"))), sum(<X>, "Versions">"<forecast version>"))`, the FC row;
72
+ - `<X> ΔPL where actual` = `if(hasValue(sum(<X>, "Versions">"Actual")), <guarded AC − PL>)`, the ΔPL row;
73
+ - `<X> ΔPL FC where no actual` = `if(not(hasValue(sum(<X>, "Versions">"Actual"))), <guarded FC − PL>)`, the ΔPL FC row;
74
+ - `<X> ΔPL % where actual` and `<X> ΔPL % FC where no actual`, the same divided by `abs` of the plan, on the % tier.
75
+
76
+ PY stays a triangle on `Versions=Actual`, `Years=Y2025`. The footnote says the cut-off follows the data, so a part-loaded month shows as AC.
77
+ - **Without a forecast**, no FC rows; the AC row still reads the closed-month measure, so a part-loaded month doesn't show as actual.
78
+ - **A cost** swaps the variance colours on its tiers (SKILL.md §2.3).
79
+
80
+ ## 2. Categorical comparison
81
+
82
+ "Which departments overspend?" Three tiles in a row, the same height and the same row order: the base w16, ΔPL w10, ΔPL % w10. All three, always: the base gives each category's size. They follow the dashboard filters.
83
+
84
+ **Base**, transposed (categories down the side, AC and PL as the series):
85
+
86
+ | Line | Variable | Members |
87
+ | --- | --- | --- |
88
+ | row `Department` | OpEx | `Reporting period=Current year`, generated from the table `Department` with `--hierarchy-max-depth 1` (its top level) |
89
+ | column `PL` | | plan version |
90
+ | column `AC` | | `Versions=Actual` |
91
+
92
+ ```json
93
+ {"type": "CHART", "chart": {"type": "COMBO_CHART", "layout": "VERTICAL",
94
+ "labels": {"showLabels": true, "labelAlign": "END", "labelFormat": KEUR0},
95
+ "spacing": {"barSpacing": -60, "marginRight": 50},
96
+ "display": {"showValueAxis": false, "showDomainAxis": true, "showLegend": false, "showIntegratedLegend": false, "domainAxisColor": "#020810", "shareAxis": true, "shareAxisGroup": GROUP},
97
+ "series": {"groupByDepth": false, "transposeData": true, "keepEmptyValue": false, "keepEmptyDomain": false},
98
+ "rowVisualizationByPath": {
99
+ "<PL>": {"color": {"solid": "#3B2A47", "border": "#3B2A47", "borderStyle": "THIN", "colorBy": "STATIC", "pattern": "NONE"}, "labels": {"showLabels": false}},
100
+ "<AC>": {"type": "STACKED_BAR_CHART", "color": {"solid": "#3B2A47", "colorBy": "STATIC", "pattern": "SOLID"}, "labels": {"showLabels": true, "labelAlign": "END", "labelFormat": KEUR0}}},
101
+ "columnVisualizationByPath": {}}}
102
+ ```
103
+
104
+ A transposed chart keys its series by the column lines, without `-0`.
105
+
106
+ **ΔPL** and **ΔPL %**: one generated row reading the variance measure (`OpEx ΔPL`, `OpEx ΔPL %`), one column `Value` without members, `"type": "STACKED_BAR_CHART"` and `"PIN_CHART"`, `"layout": "VERTICAL"`, `"transposeData": true`, `"keepEmptyValue": false`, labels `"labelAlign": "AUTO"` in the explicit format, `"showDomainAxis": false` (the base names the categories), `"spacing": {"barSpacing": 0, "marginLeft": 45, "marginRight": 75}` so negative labels fit, the `DOUBLE` axis, and the row style `{"color": {"solid": AC, "positive": "#0CB955", "negative": "#E21E09", "colorBy": "VALUE", "pattern": "SOLID"}}` under `"<Value>"` (a cost swaps the colours). ΔPL shares the base's `GROUP`; ΔPL % has `shareAxis` off. For the rest of the visualization start from the ΔPL tier of §1.
107
+
108
+ - **One order on all three.** Sort every tile of the row by the same formula, ranked by actuals:
109
+ `{"rows": {"sort": {"enabled": true, "rules": [{"direction": "desc", "customFormula": "sum($<gid of the base measure>, \"Versions\">\"Actual\", \"Reporting period\">\"Current year\")", "columnKey": ""}], "topN": 0, "includeRest": false}, "emitNoResultRows": false}}` with `farseer sheets update`. A `columnKey` sort can't do it, because the variance tiles have no AC column. A bare `$<gid>` sums every version and year and can order the rows differently. On a raw input variable the version filter returned nothing in a sort; use the bare `$<gid>` there.
110
+ - **Rank on the window.** The sort formula ignores the `Year to date` filter: add `"Reporting period">"Last closed month"` so the rank follows the close.
111
+ - **Empty and NULL members.** Generated rows can show a "NULL (Department)" row and members without data. Turn `rows.onlyWithData` and `owdIncludeMeasures` on for all three tiles, then read the three back: they must list the same members.
112
+ - **Explicit rows ignore the sort.** When a member still drops out of one tier (a blank % on a zero plan), give all three tiles explicit rows per member, created in rank order, with `onlyWithData` off, `emitNoResultRows: true` and `keepEmptyValue: true`.
113
+ - **About 25 px per bar**: size h from the bar count. A horizontal bar chart makes room for its category names itself; a set `marginLeft` on the base adds an empty strip.
114
+ - Footnotes: "Bars AC, outline PL.", "AC minus PL. Red is over budget.", "AC minus PL, in % of PL."
115
+
116
+ ## 3. Composition
117
+
118
+ "What is the mix, and how does it change?" Stacked columns over the 12 months, w18 h10, top three members and Other. Ignores the dashboard filters.
119
+
120
+ | Line | Variable | Members |
121
+ | --- | --- | --- |
122
+ | row `Product group` | Revenue | `Reporting period=Current forecast`, `Reporting period=Current year`, generated from `Product group` |
123
+ | 12 month columns | | |
124
+
125
+ Sheet: `{"rows": {"emitNoResultRows": false, "sort": {"enabled": true, "rules": [{"direction": "desc", "customFormula": "sum($<gid>, \"Versions\">\"Actual\", \"Reporting period\">\"Current year\")", "columnKey": ""}], "topN": 3, "includeRest": true}}}`.
126
+
127
+ ```json
128
+ {"type": "CHART", "chart": {"type": "STACKED_BAR_CHART", "layout": "HORIZONTAL",
129
+ "labels": {"showLabels": true, "labelAlign": "MIDDLE", "labelFormat": KEUR0},
130
+ "spacing": {"barSpacing": 20, "marginTop": 22, "marginRight": 130, "integratedLegendX": 0},
131
+ "display": {"showValueAxis": false, "showDomainAxis": true, "showLegend": false, "showIntegratedLegend": true, "showTotals": true, "integratedLegendPosition": "END", "domainAxisColor": "#020810"},
132
+ "series": {"groupByDepth": false, "transposeData": false, "keepEmptyValue": true, "keepEmptyDomain": true},
133
+ "rowVisualizationByPath": {
134
+ "<Product group>:<gid of member 1>-0": {"color": {"solid": "#3B2A47", "colorBy": "STATIC", "pattern": "SOLID"}},
135
+ "<Product group>:<gid of member 2>-0": {"color": {"solid": "#5A4868", "colorBy": "STATIC", "pattern": "SOLID"}},
136
+ "<Product group>:<gid of member 3>-0": {"color": {"solid": "#7A6B86", "colorBy": "STATIC", "pattern": "SOLID"}},
137
+ "<Product group>:rest-0": {"color": {"solid": "#E4DDEA", "colorBy": "STATIC", "pattern": "SOLID"}}},
138
+ "columnVisualizationByPath": {}}}
139
+ ```
140
+
141
+ - **Colour every member of the table**, ranked ones darkest, the rest the next grey, Other the lightest: a member that enters the top three later must not fall back to the default blue.
142
+ - **Values** in the middle of each segment and the stack total above (`showTotals`). Pick the unit so a value fits inside a bar, about four characters: whole kEUR below 1 m a month, mEUR with two decimals from 1 m, one decimal from 10 m. The tile name carries that unit, which may differ from the page unit.
143
+ - **One sign only.** A member that changes sign across the months doesn't go in a composition: build it on a subtotal without that line and footnote it.
144
+ - **A near-empty rest** (under about 3 % of the total in every month): show every member (`topN` = the member count), or drop the rest and footnote its amount.
145
+ - **The integrated legend** reserves no room: `marginRight` from the longest name, about 6.5 px a character and 8 for a capital, at least 40. `END` when the last month has data, `START` (with `marginLeft` for the names) when it can be empty, as on a model without a forecast. Legend names are written in full ("Minimum cash", not "Minimum").
146
+ - **Other** is named by the platform in every language and can't be renamed. A set in another language uses explicit rows, one per member, and a rest measure with its own name.
147
+ - Thin segments: order the rows so a thin one sits between two large ones and its label doesn't collide. Every second month label on w18 is accepted; never go wider for it.
148
+
149
+ ## 4. Cash over time
150
+
151
+ "Will the cash last the year?" A `COMBO_CHART`, w18 h10, ignoring the filters (the whole group). Row order PL, FC, AC, minimum, so the AC area is drawn over the FC area where they meet:
152
+
153
+ | Line | Variable | Members |
154
+ | --- | --- | --- |
155
+ | row `PL` | Closing cash | plan version, `Reporting period=Current year` |
156
+ | row `FC` | Closing cash from last closed month | `Reporting period=Current forecast`, `Reporting period=Current year` |
157
+ | row `AC` | Closing cash by closed month | `Versions=Actual`, `Reporting period=Current year` |
158
+ | row `Minimum cash` | Minimum cash | `Reporting period=Current year` |
159
+ | 12 month columns | | |
160
+
161
+ ```json
162
+ "rowVisualizationByPath": {
163
+ "<PL>-0": {"type": "LINE_CHART", "marker": "SQUARE", "color": {"solid": "#3B2A47", "border": "#3B2A47", "borderStyle": "THIN", "colorBy": "STATIC", "pattern": "NONE"}, "labels": {"showLabels": false}},
164
+ "<FC>-0": {"type": "AREA_CHART", "marker": "NONE", "color": {"solid": "#3B2A47", "border": "#3B2A47", "borderStyle": "THIN", "colorBy": "STATIC", "pattern": "HATCHED"}, "labels": {"showLabels": true, "labelAlign": "END", "labelFormat": KEUR0}},
165
+ "<AC>-0": {"type": "AREA_CHART", "marker": "NONE", "color": {"solid": "#3B2A47", "colorBy": "STATIC", "pattern": "SOLID"}, "labels": {"showLabels": true, "labelAlign": "END", "labelFormat": KEUR0}},
166
+ "<Minimum cash>-0": {"type": "LINE_CHART", "marker": "NONE", "color": {"solid": "#020810", "colorBy": "STATIC", "pattern": "SOLID"}, "labels": {"showLabels": false}}}
167
+ ```
168
+
169
+ Start from the base chart of §1 and change `rowVisualizationByPath` to the above, `"spacing": {"marginTop": 20, "barSpacing": 0, "marginRight": 90}`, `"keepEmptyValue": true`, and no shared axis. The FC measure overlaps AC by one month, so the areas join without a gap ([`measures.md`](measures.md) §2). Name the tile with the threshold: "Closing cash by month, minimum 2\u2009000 (kEUR)".
170
+
171
+ ## 5. Structure, 100 %
172
+
173
+ "How is the balance sheet built up?" Two `STACKED_BAR_CHART` tiles side by side, w9 h12: assets, and equity and liabilities. Rows are the parts in % of the total (measures), the columns the scenarios `AC`, `PL`, `PY` (`[Versions=Actual, Reporting period=Current year]`, the plan version, `[Versions=Actual, Reporting period=Prior year]`), `transposeData: false` so the rows are the stack. Labels `MIDDLE` in whole percent, an integrated legend at `END`, segment colours from the ramp. Start from the composition chart of §3 and change those keys. No Δ column in these charts.
174
+
175
+ ## 6. Small multiples
176
+
177
+ "How does OpEx run in each department?" A grid of small charts, one per member of a table, all on one scale, so the cells compare at a glance. Two forms:
178
+
179
+ - **One measure across many members** (departments, cities, product lines): the usual one.
180
+ - **4 to 6 KPIs side by side**, only when the user asks for an overview, and never with mixed units in one grid. Amounts and percentages go in two grids, or in separate tiles.
181
+
182
+ A single measure against plan by month is the monthly scenario chart (§1), not a grid.
183
+
184
+ **Lines: a parent and its children.** A grid needs a parent line that generates one cell per member, and child lines that are the series inside each cell; flat rows render nothing. The children inherit the parent's variable and members.
185
+
186
+ | Line | Variable | Members |
187
+ | --- | --- | --- |
188
+ | row `Department` | OpEx | `Reporting period=Current year`, generated from `Department` (`--hierarchy-max-depth 1`: the top level only, one cell each) |
189
+ | child `PL` | OpEx | the plan version |
190
+ | child `AC` | OpEx by closed month | `Versions=Actual` |
191
+ | child `FC` | OpEx by open month | `Reporting period=Current forecast` |
192
+ | 12 month columns | | |
193
+
194
+ ```bash
195
+ parent=$(line --axis row --name Department --variable OpEx --member "Reporting period=Current year" --table Department --hierarchy-max-depth 1)
196
+ line --axis row --parent-id "$parent" --name PL --variable OpEx --member Versions="Budget 2026"
197
+ line --axis row --parent-id "$parent" --name AC --variable "OpEx by closed month" --member Versions=Actual
198
+ line --axis row --parent-id "$parent" --name FC --variable "OpEx by open month" --member "Reporting period=Current forecast"
199
+ ```
200
+
201
+ For the KPI form the parent generates over a table whose members are the KPIs, and each child is one KPI. Without such a table, build one small tile per KPI instead (below); never create a table for it.
202
+
203
+ **Sheet**: cells without data drop out (the NULL member too), and the cells are ranked by size, with `farseer sheets update`:
204
+
205
+ ```json
206
+ {"rows": {"onlyWithData": true, "owdIncludeMeasures": true, "emitNoResultRows": false,
207
+ "sort": {"enabled": true, "topN": 0, "includeRest": false,
208
+ "rules": [{"columnKey": "", "direction": "desc", "customFormula": "sum($<gid of OpEx>, \"Versions\">\"Actual\", \"Reporting period\">\"Current year\")"}]}}}
209
+ ```
210
+
211
+ Over about 12 members, keep the top 12 (`topN`) and say so in the name.
212
+
213
+ **Visualization.** A cell's series key is `SHEET_PARENT:MEMBER_CHILD-0`, as in `1252_12534:135_12536-0`. The grid takes every cell's style from whichever cell is drawn first, and the ranking changes after a close, so write the PL, AC and FC styles under every member's keys, for each member `farseer dimensions members TABLE` lists (with `topN`, `sheets data` returns only today's top members). Below, one member's three keys:
214
+
215
+ ```json
216
+ {"type": "CHART", "chart": {"type": "COMBO_CHART", "layout": "HORIZONTAL",
217
+ "labels": {"showLabels": false},
218
+ "display": {"showDomainAxis": true, "showValueAxis": false, "showLegend": false, "showIntegratedLegend": false, "domainAxisColor": "#020810", "gridColumns": 3},
219
+ "series": {"groupByDepth": true, "transposeData": false, "keepEmptyValue": true, "keepEmptyDomain": false},
220
+ "spacing": {"barSpacing": -60, "gridGapX": 20, "gridGapY": 30},
221
+ "rowVisualizationByPath": {
222
+ "<Department>:<member gid>_<id of PL>-0": {"color": {"solid": "#3B2A47", "border": "#3B2A47", "borderStyle": "THIN", "colorBy": "STATIC", "pattern": "NONE"}, "labels": {"showLabels": false}},
223
+ "<Department>:<member gid>_<id of AC>-0": {"type": "STACKED_BAR_CHART", "color": {"solid": "#3B2A47", "colorBy": "STATIC", "pattern": "SOLID"}},
224
+ "<Department>:<member gid>_<id of FC>-0": {"type": "STACKED_BAR_CHART", "color": {"solid": "#3B2A47", "border": "#3B2A47", "borderStyle": "THIN", "colorBy": "STATIC", "pattern": "HATCHED"}}},
225
+ "columnVisualizationByPath": {}}}
226
+ ```
227
+
228
+ - `groupByDepth: true` turns the parent and its children into the grid. `gridColumns` is the cells per grid row: 3 for up to 9 cells, 4 above.
229
+ - **One scale for every cell**, the point of the grid. Labels off: the cells are small, and the user reads shape and size, not values. With AC only (no plan), one child and labels on in whole units are fine.
230
+ - Every cell of a KPI grid shares the unit, and the polarity sits on each KPI's measure.
231
+ - No legend: the notation key and the footnote explain AC, FC and PL.
232
+ - Size: w36 for 6 to 12 cells, about h7 per cell row plus 4 (two rows of three took h18). Ignores the dashboard filters, like every monthly chart. Footnote: "AC solid to the last closed month, FC hatched after, outline PL. One scale, largest first."
233
+
234
+ **Without a grid: one tile per KPI.** When the KPIs are separate variables in different units, build a small chart per KPI, each with its own format and unit in its name ("Net sales (mEUR)"): the monthly scenario chart of §1 without tiers, w12 h8, three in a row.
235
+
236
+ ## 7. Rules for every chart
237
+
238
+ - **Value labels above the bar** (`labelAlign: END`) on every column or bar chart; `MIDDLE` only on a stacked composition. AC&FC stacking on a monthly chart is not a composition. When END labels collide with PY triangles, follow the PY rule (§1), never move the labels inside.
239
+ - **Margins give labels room, and no more**: `marginRight` 20 to 50 for END labels, from the legend names for an integrated legend, never a flat 180. A clipped label is a defect, and so is a visible gap.
240
+ - **Variance tiles under a base chart** hide their category labels (`showDomainAxis: false`) and keep the semantic axis line. Every absolute variance has its relative one beside it, except where §1 drops the % tier.
241
+ - **Outliers.** `groupOutliers` exists on table columns only; a chart pin draws every value full length, so the % measure is blank where its base is zero, negative or near zero.
242
+ - **Top N** for any table over about 8 members: `"sort": {"enabled": true, "rules": [{"columnKey": "<AC>", "direction": "desc", "customFormula": ""}], "topN": 5, "includeRest": true}` appends an "Other" row with the rest. `columnKey` sorts by a column of the sheet, `customFormula: "$<gid>"` with `"columnKey": ""` by a variable.
243
+ - **The user's own sort** (`data.showTileSort: true`) only on a standalone ranked chart: its chip pushes the plot down, so never on a tile that sits level with a neighbour.
244
+ - **Legends** off (`showLegend: false`); the notation key in the header explains the scenarios. An integrated legend only on composition and structure charts.
245
+ - **Category names.** A chart shows the member name only; when the names are codes, use explicit rows with readable names.
@@ -0,0 +1,91 @@
1
+ # Check
2
+
3
+ Read before you report a build, and when something renders wrong.
4
+
5
+ ## 1. Checklist
6
+
7
+ - [ ] **What must exist exists.** Every monthly chart has its tiers, every composition chart its integrated legend, every cascading statement ΔPL as a variance waterfall on the AC and PL scale (bars where the plan stops above some lines). The notation key and title line 3 list exactly the scenarios the page shows. The Reporting setup page has every reporting member, Last closed month included.
8
+ - [ ] **Every tile read back** with `farseer sheets data SHEET_ID --json`: lines kept their variable and members (`farseer sheets lines`), cells have values, and a cell or two equal `farseer formula eval` for the same slice. `sheets data` reads a tile without the dashboard filters, so a year-to-date column shows the full year there: check year-to-date values and filter picks with `formula eval` (`"Year to date">"M8"`, `"Department">"Sales"`).
9
+ - [ ] **One ΔPY against AC − PY from the source**, and one ratio under a filter pick: a check that rebuilds each cell from the tile's own members misses the intersection traps.
10
+ - [ ] **Totals agree**: cards equal the table totals, a breakdown adds up to its total, a bridge or statement adds up (opening plus rows equals closing) under one value in every filter.
11
+ - [ ] **Every tile follows every dashboard filter, or says which it ignores** in its footnote or name ("Service revenue, group").
12
+ - [ ] **Every key in a visualization is one the data returns.** A stale key styles nothing and the series falls back to the default blue.
13
+ - [ ] PL is never filled, FC is hatched, AC is the darkest thing on the page. Green and red only on variances, and an overspend is red: check one cost line. Variances of balances are neutral.
14
+ - [ ] Every table row has a light line, totals the ink one.
15
+ - [ ] Side-by-side tiles: equal heights, footnotes of one line each, plots level.
16
+ - [ ] No 12-month chart wider than w18, small multiples aside. No clipped label, legend or column, and no empty strip beside a chart.
17
+ - [ ] No signed zero ("+0", "−0,0", a card badge "+0,0 (0,0%)"), no blank or NULL member row (name it "Unassigned" or leave it out and say so).
18
+ - [ ] Every tile with amounts has its unit in the name, spelled as in the title.
19
+ - [ ] Every message opens with its scope, carries no numbers, and its direction matches the unfiltered tiles. Every variance in a text names its comparison and period, every member by name.
20
+ - [ ] No text on a page about what is missing or wasn't built. No pie, no decorative colour.
21
+ - [ ] Every card answers a question the business asks.
22
+
23
+ The look (clipped labels, wrapped dividers, labels on triangles, level plots) shows only on screen. Size it by the rules above, and ask the user to look over the page once.
24
+
25
+ ## 2. Traps
26
+
27
+ | Symptom | Cause | Fix |
28
+ | --- | --- | --- |
29
+ | An overspend shows green on a cost ΔPL % chart | the measure is `NEGATIVE` and the chart colours are swapped too, so it flips twice | `labels.labelFormat.polarity: POSITIVE` on the chart |
30
+ | Cost colours inverted in a table | polarity in a column's `labelFormat` | polarity on the rows only |
31
+ | Grey row lines don't show | set on `""` only | write them on every row key, children included |
32
+ | The PL waterfall is invisible or a bare line | `TREND` draws the bar from the column colours | every PL colour the AC colour, `pattern: NONE`, `border` and `borderStyle: THIN` |
33
+ | One month shows AC and FC stacked into one tall column | the AC row reads the plain measure, so an unclosed or reopened month with actuals shows both | AC rows read "… by closed month"; test by pointing Last closed month one month back |
34
+ | A ΔPL measure shows only the AC value, or a splice measure is empty | the line also carries a version that intersects the version in the formula | measures that name a version go on lines without one |
35
+ | A ΔPY tier or tile shows the current year, or nothing | the ΔPY measure names Prior year and the line carries Current year: both point at Years | a stored prior-year series, or ΔPY measures that name both years on lines without a year ([`measures.md`](measures.md) §2) |
36
+ | A column shows the same total on every subtotal row | the column's variable overrides each row's variable | a column variable only where every row is one variable with a member |
37
+ | A ratio is wrong, part of its formula blank | a member on the column that the measure also fixes inside its formula | the period on the column only, the measure free of fixed members |
38
+ | A tier shows a few months spread over the full width | `keepEmptyValue` off; an FC row hides it until a model has no forecast | `keepEmptyValue: true` on every tier and the base |
39
+ | End labels sit on the PY triangles | values small next to PY | without PL, PY is a column; with PL, drop the triangle on that chart. Never move the labels inside |
40
+ | Labels in the middle of single columns | `labelAlign: MIDDLE` outside a composition | `END` |
41
+ | A composition chart's legend is missing | an `END` legend draws next to the last month, which is empty without a forecast | `START`, with `marginLeft` from the longest name |
42
+ | "Other" twice in a composition legend | the model has a member named "Other" and the chart adds the rest | show every member |
43
+ | A 100 % chart shows the scenarios as the stack, in blue | `transposeData: true` | `false`: the columns are the scenarios, the rows the stack |
44
+ | A Δ column between two % columns reads −116,8 % for a 1-point change | a percentage label format on the COMPARISON column | a number format in points ([`tables.md`](tables.md) §2) |
45
+ | A breakdown table draws a staircase | AC or PL as a waterfall on rows that aren't a P&L | numbers and ΔPL bars ([`tables.md`](tables.md) §1) |
46
+ | A chart beside a table reads a different number | the chart lacks a member the table carries (a stage, a version, a currency) | give the chart the table's members |
47
+ | A % row in a statement shows nothing in the AC or PL column | a waterfall can't draw a ratio next to amounts in thousands | margins in their own table |
48
+ | A pin column draws markers on rows without a plan | a pin draws a marker at zero for every row without a value | pins only where every row has a value; otherwise a coloured number |
49
+ | The whole AC shows as ΔPL on unbudgeted lines | COMPARISON reads an empty PL as 0 | a ΔPL measure blank there ([`tables.md`](tables.md) §1) |
50
+ | A categorical tier is one row short and the tiers stop lining up | a member without a plan drops from the % tier | explicit rows in rank order on all three tiles |
51
+ | A table or chart shows every member, empty ones and a "NULL" row included | generated rows without `onlyWithData` | `rows.onlyWithData: true` with `owdIncludeMeasures: true`; on categorical tiers then check the three tiles list the same members |
52
+ | A parent line shows no detail under only-with-data | generated rows on a measure are dropped unless `owdIncludeMeasures` is on | set it |
53
+ | A line repeats its parent's number | the line carries a dimension the variable doesn't carry; the member drops | build the hierarchy from what the variable carries |
54
+ | A subtotal opens into detail | the subtotal row was given children | only lines open |
55
+ | An exact zero reads "+0,0" | a variance format with two sections | a zero section: `+#,##0.0,;-#,##0.0,;0.0,` |
56
+ | A comparison column reads "−0,0" | the value rounds to zero but isn't zero, and a COMPARISON can't be guarded | a guarded ΔPL measure as the column's variable, or accept it and keep it out of the message |
57
+ | A balance reads a sum of months | the balance rolls up `Sum` | `Closing State`; check the rollup before you build |
58
+ | PY is empty or tiny for the whole year while its months are fine | December of the prior year holds the year-end closing entry | PY year to date only, no PY on monthly charts |
59
+ | A card shows no badge | its sheet has one number column | expected; the badge needs a second column |
60
+ | A card's badge disappears | a footnote on the card pushes it out | never footnote a card |
61
+ | The sparklines under the cards are empty | the page filters one month and the sparklines follow it | `useDashboardFilters: false` on the sparklines of that page |
62
+ | A flag stays empty although an inline evaluate returns 1 | a constant in value position creates no cells | a stored variable in value position (`"Period anchor"`), then read the stored flag |
63
+ | A variable with a grain is refused, "Calculation formula cannot reference measures" | a stored variable reads a measure | point it at the stored input variables |
64
+ | A formula is refused, "Expected variable" | `or("Dim">"A", "Dim">"B")` as a condition | `or(hasDMember("Dim">"A"), hasDMember("Dim">"B"))` |
65
+ | A formula is refused, too many timeline functions | more than 32 `delay` or windowed calls | the fallback inside the delay: `delay(if(hasValue(x), x, x @ AC), k)` |
66
+ | A formula is refused, "Invalid formula length" | over 8,096 characters | split it into measures per branch |
67
+ | An evaluate answers "Expected table name" | a bare member in an evaluated formula | `"<Table>">"<Member>"` |
68
+ | A column width is ignored | `columnWidth` at the top of the column object | `spacing.columnWidth` with `spacing.gridGap`, the name column too |
69
+ | A table is cut off on the right, its last columns missing | chart columns wider than the defaults: waterfalls and bars reserve label room on both sides of their `columnWidth` | the widths of [`tables.md`](tables.md) §6 (a P&L waterfall 90, not 260), or show the second % variance as a coloured number |
70
+ | A tile grew and pushed the tiles below down | the grid moves them to make room | check the rows below still line up |
71
+ | The page collapses into one column | a tile without `absolute`, or the dashboard on a responsive layout | every tile under `absolute`, and `"responsiveLayout": false` in the dashboard's options |
72
+ | An empty strip left of a horizontal bar chart | a set `marginLeft` | 0: the chart reserves room for the names |
73
+ | Integrated legend labels sit far from the line ends | `integratedLegendX` at its default of 100 px | 0 on every chart with an integrated legend |
74
+ | A duplicated dashboard ignores its filters | duplicating sets `useDashboardFilters: false` on every tile | set it back on each tile |
75
+ | A new filter doesn't show for one user, or a chart shows extra columns ("Jan/2026 Actual") | that user's personal view of the dashboard | the user clicks Reset config |
76
+ | A card or table shows the group under an Entity or Location filter | the variable doesn't carry that dimension, and the filter drops without a sign | say it on the tile |
77
+ | A footnote doesn't show | `showFootnotes` off | turn it on in the tile `style` |
78
+ | A divider sits on the wrong line | the block count changed, or the divider wraps | keep four blocks, shorten the underscores |
79
+ | Several spaces collapse in text | whitespace collapses | non-breaking spaces (`\u00a0`) |
80
+
81
+ ## 3. A refused request
82
+
83
+ A bare `BadRequest` is a payload that doesn't match, not a refusal:
84
+
85
+ - **`farseer dashboards update`**: `columns`, `rows` and `options` each replace the stored object, so send each one whole, filters and sort included.
86
+ - **A sort**: every rule needs `direction`, `customFormula` (`"$<gid>"` or `""`) and `columnKey` (`""` when sorting by formula), plus `enabled`, `topN` and `includeRest`.
87
+ - **A tile**: the whole `data` object of SKILL.md §3.1; a field placed on `visualization` itself is dropped.
88
+ - **A placement**: `gridPlacements` takes `absolute` (the fixed grid), or `large` and `small` on a responsive dashboard; any other key is refused.
89
+ - **A dashboard filter**: every filter needs `displayColumns`.
90
+
91
+ Correct the payload against this skill and send it again.
@@ -0,0 +1,88 @@
1
+ # Measures
2
+
3
+ The measures the blocks read, written so they work on any model: only the names of the variables and members change. A dashboard build only adds to the model. It never changes or deletes a variable that was there before.
4
+
5
+ ## 1. Before you create one
6
+
7
+ **Reuse first.** Search the model for a measure with the same meaning (net sales, EBITDA, margins, OpEx), by name and formula, and compare its numbers for every version the page shows before you use it. Two variables can differ on one version only. A measure you build for a KPI the model already has must equal it on Actual first; name any difference.
8
+
9
+ **No measure for a plain slice.** A measure that is only `sum(<variable>, <member>)` is not built: put the member on the line instead. The sheet sends the same formula, so the numbers are identical under every filter, and the model gets fewer additions. Build a measure only for two members of the same table (members of one table on a line AND, so two plain members give nothing; the Reporting period members are the exception, since each points at a different table), arithmetic across variables or versions, the closed and open month measures, and guards.
10
+
11
+ **How a measure meets the line's members.** A filter written inside a measure intersects with the members of its row and column; it doesn't override them. `Reporting period` members combine when they point at different tables: `"Reporting period">"Current forecast"` in a measure on a line of `Current year` reads the forecast of the current year (verified). Two that point at the same table, `Prior year` in the measure and `Current year` on the line, give nothing. A measure with `"Versions">"Actual"` on a column of the plan version is empty. So a measure that names a version goes only on lines without a version member. The other way round, a column's variable wins over the row's variable in every cell: a ΔPL column bound to a plan-gated measure leaves ΔPL blank on lines without a plan.
12
+
13
+ **An existing measure that breaks a rule here** is not changed by a dashboard build. Without the half-unit guard: wrap it in a guarded measure that reads it, named after it with `label` ("Net sales ΔPL label by closed month"). When it names the forecast version instead of `Current forecast`, or the fix is more than a guard, a wrapper can't help: write the kit's measure under its own name. List both kinds in your report.
14
+
15
+ **The plan.** Lines read `Reporting period=Current budget` when the table has that member. When it doesn't, name the budget version itself, and say in your plan that adding `Current budget` would make a new budget a rollover too.
16
+
17
+ **Names.** Name a measure after its variable and what it shows: `Net sales ΔPL by closed month`, `OpEx ΔPL %`. Check the name against the model's variables and members, case included: a name that is also a member can resolve to the member, so on a clash prefix the measures ("DB Revenue"). An existing name is refused.
18
+
19
+ **Where they go.** Group the build's measures in one folder, `Variables/Dashboards` (`farseer folders create Dashboards --parent-path Variables`), read-only (`--readonly`). Leave `--description` empty: a description can show as the row label.
20
+
21
+ ## 2. The kit
22
+
23
+ A measure is a variable with a formula, created with `--measure`. A stored variable keeps its own dimensions (`--dimensions`) and a rollup. Placeholders: `<PNL>` the P&L input variable, `<line attribute>` and `<section attribute>` its attributes that pick a line or a section, `<net sales member>`, `<opex member>` their members; `<net sales>`, `<COGS>`, `<EBITDA>` the measures of those names, written in a formula as `sum("Net sales")`; `<AC>` the actuals member, `<PL>` the plan, as `"Reporting period">"Current budget"` or `"Versions">"<budget version>"` (§1); `<X @ AC>` is `<X>` with `"Versions">"<AC>"` added to each `sum`, `<X @ PL>` with the plan.
24
+
25
+ **Lines and subtotals.** `$KEUR1` and `$PCT1` hold number formats from SKILL.md §2.5 as JSON.
26
+
27
+ ```bash
28
+ farseer variables create --measure --readonly --folder-path "Variables/Dashboards" --name "Net sales" \
29
+ --formula 'sum(<PNL>, "<line attribute>">"<net sales member>")' --number-format "$KEUR1"
30
+ farseer variables create --measure --readonly --folder-path "Variables/Dashboards" --name "EBITDA" \
31
+ --formula '<net sales> - <COGS> - sum(<PNL>, "<section attribute>">"<opex member>")' --number-format "$KEUR1"
32
+ farseer variables create --measure --readonly --folder-path "Variables/Dashboards" --name "EBITDA margin %" \
33
+ --formula 'if(gt(<net sales>, 0), <EBITDA> / <net sales>)' --number-format "$PCT1"
34
+ ```
35
+
36
+ - A cost stored negative gets a magnitude measure for cards, sparklines and cost charts: `-1 * sum(<PNL>, …)` with polarity `NEGATIVE`. Never `0 - sum(…)`: the constant makes 0 cells outside the data.
37
+ - A cost ratio divides by a denominator without the cost's breakdown dimensions, so a department pick keeps the company's net sales: a stored variable `Net sales all departments` on every dimension of `<PNL>` except Department and Cost centre, `= sum(<PNL>, "<line attribute>">"<net sales member>")`.
38
+
39
+ **A ΔPL blank where there is no plan**, for a statement whose rows are members of one variable ([`tables.md`](tables.md) §1): `<X> ΔPL` = `if(hasValue(<X @ PL>), if(not(lt(abs(<X @ AC> - <X @ PL>), <half unit>)), <X @ AC> - <X @ PL>))`, bound as the ΔPL column's variable.
40
+
41
+ **Monthly chart measures.** They gate on the period flags ([`reporting-period.md`](reporting-period.md) §2) with a condition, never a product, and are read by month columns only, never a year-to-date column:
42
+
43
+ | Name | Formula | Read on |
44
+ | --- | --- | --- |
45
+ | `<X> by closed month` | `if(hasValue(sum("Period is closed")), <X>)` | the AC row, `Versions=Actual` |
46
+ | `<X> by open month` | `if(hasValue(sum("Period is open")), <X>)` | the FC row, `Reporting period=Current forecast` |
47
+ | `<X> ΔPL by closed month` | `if(hasValue(sum("Period is closed")), if(not(lt(abs(<X @ AC> - <X @ PL>), <half unit>)), <X @ AC> - <X @ PL>))` | the ΔPL tier |
48
+ | `<X> ΔPL by open month` | the same on `"Period is open"` with `<X @ FC>` | the ΔPL FC tier |
49
+ | `<X> ΔPL % by open month` | the ΔPL % formula on `"Period is open"` with `<X @ FC>` in place of `<X @ AC>` | the ΔPL % FC tier |
50
+ | `<X> ΔPL % by closed month` | `if(hasValue(sum("Period is closed")), if(not(lt(abs(<X @ PL>), <half unit>)), if(not(lt(abs(<r>), <half % unit>)), if(not(gt(abs(<r>), 1)), <r>))))` with `<r>` = `(<X @ AC> - <X @ PL>) / abs(<X @ PL>)` | the ΔPL % tier |
51
+ | `Closing cash by closed month` | `if(hasValue(sum("Period is closed")), sum(<cash>))` | the cash AC area |
52
+ | `Closing cash from last closed month` | `if(hasValue(sum("Period is last closed or open")), sum(<cash>))` | the cash FC area, one month of overlap |
53
+
54
+ The AC row always reads the closed-month measure: a month can hold actuals and still be open (loaded but not closed, reopened, seeded zeros), and an ungated AC row then stacks on the FC row of the same month. Write the FC measures on `"Reporting period">"Current forecast"`, never on the version's name, so a new forecast touches no measure. `<X @ FC>` is `sum(<X>, "Reporting period">"Current forecast")`.
55
+
56
+ **A forecast version that holds only its forecast months** needs an `<X> AC&FC` measure for cards, sparklines and charts, on lines without a version member: `if(hasValue(sum("Period is closed")), <X @ AC>, <X @ FC>)`.
57
+
58
+ **Against PY by month.** The tier rows carry `Current year`, so a measure that names `Prior year` intersects with it and returns the current year. Read a stored series instead:
59
+
60
+ ```bash
61
+ farseer variables create --readonly --folder-path "Variables/Dashboards" --name "<X> by month" \
62
+ --dimensions "Years,Months" --rollup Sum --formula '<X @ AC>'
63
+ farseer variables create --readonly --folder-path "Variables/Dashboards" --name "<X> prior year by month" \
64
+ --dimensions "Years,Months" --rollup Sum --formula 'delay("<X> by month", 12)'
65
+ ```
66
+
67
+ then `<X> ΔPY by closed month` = `if(hasValue(sum("Period is closed")), if(not(lt(abs(sum("<X> by month") - sum("<X> prior year by month")), <half unit>)), sum("<X> by month") - sum("<X> prior year by month")))`, and the % the same way with the guards. The series keep only years and months, so they ignore the other filters: right for monthly charts, never in a filtered table. When `<X>` is itself a measure, a stored series can't read it: the ΔPY measures then name both years themselves and the tier rows take no year. Their gate names the current year too, or it is true in every month (`Period is closed` covers all of the prior year):
68
+
69
+ - `<X> ΔPY by closed month` = `if(hasValue(sum("Period is closed", "Reporting period">"Current year")), if(not(lt(abs(<d>), <half unit>)), <d>))` with `<d>` = `sum(<X>, "Versions">"<AC>", "Reporting period">"Current year") - sum(<X>, "Versions">"<AC>", "Reporting period">"Prior year")`;
70
+ - `<X> ΔPY by open month`: the same on `sum("Period is open", "Reporting period">"Current year")`, with `sum(<X>, "Reporting period">"Current forecast", "Reporting period">"Current year")` as the current side;
71
+ - the % versions divide `<d>` by `abs` of the prior-year side, with the guards of the ΔPL % above.
72
+
73
+ **LTM** is a stored variable on the time grain: the month plus eleven `delay` terms, `<X> + delay(<X>, 1) + … + delay(<X>, 11)`, rollup `Closing State`. Timeline functions don't work in measures. Check one month by hand: LTM = full prior year − prior year to date + year to date. A formula takes at most 32 timeline calls. On a version without prior-year data, the fallback to Actual goes inside each `delay`.
74
+
75
+ **Share of total**: a stored variable without the breakdown dimension (`Net sales all products`, every dimension of the sales input except Product), then the measure `if(gt(sum("Net sales all products"), 0), sum(<SALES>) / sum("Net sales all products"))`. Under a filter on the breakdown, the share keeps the all-members base, and "sums to 100 %" holds only unfiltered: the footnote says so.
76
+
77
+ **Leverage**: `Net debt / EBITDA LTM` = `if(gt(sum("EBITDA LTM"), 0), (<borrowings> - <cash>) / sum("EBITDA LTM"))`, with `EBITDA LTM` stored on the entity, versions, years and months over a stored `EBITDA by month` whose formula reads `<PNL>` directly. A stored variable can't read the `EBITDA` measure.
78
+
79
+ ## 3. Guards
80
+
81
+ - **Half a label unit.** A variance below half the unit its label shows is blank, never 0: 500 for whole kEUR, 50 for kEUR with one decimal, 0.0005 for a % with one decimal. Rounding alone still prints "+0". No % where the plan is under half a unit: a 0.4 EUR plan printed "+0,0" and "+100,0 %".
82
+ - **Outliers on % tiers.** Blank where |Δ%| > 100 %, and the footnote says so; the amount tier beside it still shows the amount.
83
+ - **The card badge guard** returns the plan only where the difference is at least half a display unit of the card, so AC and PL a few euros apart show no "+0,0 (0,0%)": `<X> PL badge` = `if(not(lt(abs(sum(<X>, "Versions">"<AC>") - sum(<X>, <PL>)), <half unit>)), sum(<X>, <PL>))`, where `<PL>` is the whole plan filter (SKILL.md §1, The plan). It names both scenarios, so its column takes no member.
84
+ - **A ratio's denominator from a measure.** A stored variable can't read a measure. When the P&L is a measure, build the denominator from the measure's stored operands, check it equals the measure on every version the page shows before a tile reads it, and say in your report that it must follow when the measure changes.
85
+
86
+ ## 4. Read back
87
+
88
+ Read every new stored variable (the flags, series, LTM) back as stored with `farseer cells query`, never only an inline `farseer formula eval`: an inline evaluate returned 1 where the stored variable was empty. A measure has no dimensions, so `cells query` refuses filters on it: read a measure with `farseer formula eval` (`sum("<measure>", "Months">"M9", "Reporting period">"Current year")`) or through a tile. The flags must show 1 and empty on the last closed month and the first open one. A closed-month measure must be empty in the wrong half of the year. Card totals must equal the table totals.
@@ -0,0 +1,99 @@
1
+ # The page
2
+
3
+ How a dashboard is laid out: its settings, the grid, the header, section headings, footnotes and the cover page. A single chart on a new dashboard of its own still takes the settings of §1 (without filters) and the grid of §2, and skips the header, headings and cover.
4
+
5
+ ## 1. Dashboard settings
6
+
7
+ Right after `farseer dashboards create`, send the settings whole with `farseer dashboards update ID --input settings.json`:
8
+
9
+ ```json
10
+ {"columns": {"intervalToolbar": {"enabled": false, "intervalStart": null, "intervalEnd": null, "filteredYears": [], "periods": ["month", "year"], "showSum": false},
11
+ "comparison": {"versionsByYear": {}, "comparisons": [], "operations": ["minus"]}},
12
+ "options": {"gridLocked": false, "responsiveLayout": false, "autoRefresh": true},
13
+ "rows": {"onlyWithData": false, "owdIncludeMeasures": false, "emitNoResultRows": true, "sort": {"rules": [], "enabled": false},
14
+ "filters": [
15
+ {"tableId": DEPARTMENT_TABLE_GID, "dimensionIds": [], "displayColumns": [], "selectAll": true, "selectBlanks": true, "multiselect": true, "autoApply": true, "blanks": true},
16
+ {"tableId": YEAR_TO_DATE_TABLE_GID, "dimensionIds": [M8_GID], "displayColumns": [], "selectAll": false, "selectBlanks": false, "multiselect": false, "autoApply": true, "blanks": false}]}}
17
+ ```
18
+
19
+ - The timeline is off: the lines carry the periods, and the timeline would add its own period columns after every tile's month lines.
20
+ - `responsiveLayout: false` puts the page on the fixed grid below, so it looks the same on every screen.
21
+ - **Filters.** A filter goes on a page only when it reaches every number on it, or the statement ends before the first line it doesn't reach: list which measures carry the filter's dimension, directly or through a link. Never a filter on the plan version (PL is the approved budget), and never one the model doesn't carry.
22
+ - **The period filter** is the system table `Year to date`, single-select, defaulting to the last closed month, placed last. Pages of states (balance sheet, headcount) filter one month of `Months` instead ([`reporting-period.md`](reporting-period.md) §1).
23
+ - `farseer dimensions members TABLE --json` gives the member gids for `dimensionIds`, and each member's `parentId` is the table gid for `tableId`. `"displayColumns": []` shows the chip as the reference build does; `[2]` shows member names.
24
+
25
+ ## 2. The grid
26
+
27
+ `absolute` placements: 36 columns of 30 px (a w36 page is about 1,080 px), rows of 30 px. Create every tile with its box under `absolute`. Every dashboard starts the same way:
28
+
29
+ | Row | Tiles |
30
+ | --- | --- |
31
+ | y0 h3 | logo `x0 w8`, notation key `x26 w10` |
32
+ | y3 h3 | title `x0 w10`, message `x10 w26` |
33
+ | y6 → | sections: a heading (h3), then its content, repeated |
34
+
35
+ - When title line 3 runs over about 45 characters, title w12 and message w24.
36
+ - Sections follow each other with no empty grid rows. Tiles in one row have the same height.
37
+ - Every chart with 12 month columns is **w18**, never full width; two sit side by side. Small multiples are the exception: a grid takes w36.
38
+ - No logo at hand: the y0 row holds only the notation key, and everything else stays where it is. Never invent or redraw a logo.
39
+ - **Height of a table**: about one grid row per table row plus three for the name, the header and the footnote (on the reference build 5 rows took h8, 15 rows h16). A statement adds the rows of its largest line opened one level, up to 12.
40
+
41
+ ## 3. Header tiles
42
+
43
+ Every text tile: `"style": {"showBorder": false, "hasShadow": false, "showBackground": false}`, and `data` `{"type": "TEXT", "rawContent": {"blocks": [...], "entityMap": {}}}`. A block:
44
+
45
+ ```json
46
+ {"key": "a2", "text": "Budget vs Actual in kEUR", "type": "unstyled", "depth": 0,
47
+ "inlineStyleRanges": [{"offset": 0, "length": 16, "style": "BOLD"}], "entityRanges": [], "data": {}}
48
+ ```
49
+
50
+ Inline styles that exist: `BOLD`, `ITALIC`, `UNDERLINE`, `SIZE_10`, `SIZE_12`, `SIZE_14`, `SIZE_18`, `COLOR_UI`, `COLOR_PRIMARY`, `COLOR_ERROR`, `COLOR_NEUTRAL`. No hex colours.
51
+
52
+ **Logo.** One `atomic` block whose entity is the PNG as a data URL; `width` is a percent of the tile width. A logo under about 4:1 at 100 % is taller than the row and cut: lower `width` until it is about 40 px high. Keep the file under about 100 KB.
53
+
54
+ ```json
55
+ {"blocks": [{"key": "logo1", "text": " ", "type": "atomic", "depth": 0, "inlineStyleRanges": [], "entityRanges": [{"offset": 0, "length": 1, "key": 0}], "data": {}}],
56
+ "entityMap": {"0": {"type": "IMAGE", "mutability": "IMMUTABLE", "data": {"src": "data:image/png;base64,...", "width": 100}}}}
57
+ ```
58
+
59
+ **Title**, four blocks:
60
+ 1. the company name;
61
+ 2. the page name in `BOLD`, then the unit: "**Budget vs Actual** in kEUR";
62
+ 3. the period and scenarios, never a month: "2026 year to date AC and PL", "2026 year to date AC, PL and PY, full year AC&FC", "2026 month end AC, PL and PY". `..` is a span, `&` one spliced series, `and` both scenarios;
63
+ 4. a divider of underscores.
64
+
65
+ **Message**, four blocks: the takeaway in `BOLD` / one supporting sentence / empty / divider. The divider sits on line 4 so it lines up with the title's. Written after the data tiles exist, from the numbers you read back, and without numbers (SKILL.md §2.7). On a page with nothing to say, widen the title instead.
66
+
67
+ **Notation key**, four blocks: three empty, then `"■ AC\u00a0\u00a0\u00a0 ▨ FC\u00a0\u00a0\u00a0 □ PL\u00a0\u00a0\u00a0 ■ PY"` (as a JSON string) in `SIZE_12`, only the scenarios on the page. Between two items three non-breaking spaces and one plain space; plain spaces alone collapse. PY gets `COLOR_NEUTRAL` on its square.
68
+
69
+ **Divider lengths** that render on one line: title w10 70 underscores, title w12 84, message w26 130, message w24 120, heading w18 120, heading w36 246, cover block w26 132. A wrapped divider is a defect: shorten it.
70
+
71
+ ## 4. Section headings
72
+
73
+ One text tile per section, h3, the full width of what it heads, four blocks:
74
+
75
+ 1. the topic in capitals, `BOLD` and `SIZE_18`: "CASH";
76
+ 2. the question the section answers, `SIZE_12` and `COLOR_NEUTRAL`: "Will it last the year?";
77
+ 3. empty;
78
+ 4. the divider.
79
+
80
+ Questions are short and plain: "Are we on budget?", "Which lines miss the budget?", "Where did the cash go?", "Who is behind?". One heading per row of tiles about one subject; two side by side only when the tiles below answer different questions. A card row right under the title has no heading.
81
+
82
+ ## 5. Tile names and footnotes
83
+
84
+ - **Every data tile is named**, with the unit at the end ("Top 5 products by net sales, AC and PL YTD (kEUR)"), unless it is the only tile under its heading and the heading already says it. A KPI card is named by its KPI only; sparklines and variance tiers under a base chart are unnamed or name their tier ("Net sales ΔPL %").
85
+ - `subtitle` renders only with `"showSubtitle": true` in `style`; leave it off and put what matters in the name.
86
+ - **Every chart and table gets a footnote**: how to read it, what the filters do. Cards, sparklines and the variance tiers above a monthly chart get none; the base chart's footnote speaks for its tiers. A footnote renders only with `"showFootnotes": true` in `style`: merge it in, don't replace the style.
87
+ - **Tiles side by side get footnotes of one line each**, or a wrapped footnote pushes its chart up and the row goes out of line: "Bars AC, outline PL.", "AC minus PL. Red is over budget.", "AC minus PL, in % of PL.", "Follows the filters.", "Ignores the filters."
88
+
89
+ ## 6. The cover page
90
+
91
+ For a set of pages: a dashboard "Management report", first in the folder. The folder lists dashboards in the order they were created and the CLI can't reorder them, so create it first, empty, and fill it last when every page exists.
92
+
93
+ - The logo row and title like every page ("Management report in kEUR"), one overall message.
94
+ - One block per page: a text tile `x0 w26 h4` with the page name in capitals `BOLD SIZE_18` / empty / that page's message line 1 in `BOLD` / line 2 / divider; beside it at `x26 w10 h4` a sparkline of that page's headline number ([`cards.md`](cards.md) §2), named ("Closing cash, AC&FC and PL"). Pick headline numbers whose lines look different.
95
+ - Each page name links to its dashboard: an entity `{"type": "LINK", "mutability": "MUTABLE", "data": {"url": "#/dashboard/<id>"}}` in `entityMap`, and an `entityRanges` entry over the name's text. Only `https://` and in-app `#/` links render. They take the platform's blue, the one blue allowed.
96
+
97
+ ## 7. Decoration
98
+
99
+ Allowed: the logo, the notation key, thin dividers, grey row lines, the question under a heading. Nothing else: no backgrounds, shadows, borders, icons, emoji, coloured headings or banners. Farseer draws each tile as its own rounded box, so a background never forms a band; it reads as loose grey tiles.