You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
Alex Bikeyev
committed
docs: clarify group purpose, add multi-dimensional view guidance, expand formatting with presets, and update script workflow examples
Update groups-and-hierarchies.md to describe groups as used for hierarchy, outline, navigation, and presentation (not just rules and views). Add multi-dimensional view example to views.md showing how third and subsequent dimensions become page/filter axes. Expand formatting.md with OM Core preset expressions section documenting preset:number() syntax and common parameters
The first dimension is used for rows, the second for columns, and remaining dimensions become page or filter axes. The UI displays the selected page values and lets you switch between them. If you need a different layout, create a separate view with the dimensions in a different order.
46
+
39
47
## Activating a view
40
48
41
49
You can activate a view by giving its name without the cube assignment:
Copy file name to clipboardExpand all lines: docs/reference/formatting.md
+29-2Lines changed: 29 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,8 +51,35 @@ CLDR also defines compact patterns for values like `1M` or `1 million`. These pa
51
51
52
52
## OM Core usage
53
53
54
-
When you set a format string in OM Core, you are writing a CLDR-style pattern. The engine resolves the pattern against the locale and value type of the cell or cube. This means the same model can be displayed correctly across different locales without changing the underlying data.
54
+
When you set a format string in OM Core, you can write either a CLDR-style patternor an OM Core preset expression.
55
55
56
-
For the full specification, see the CLDR documentation:
56
+
### CLDR-style patterns
57
+
58
+
A CLDR-style pattern is a locale-aware pattern resolved against the cell or cube locale:
This means the same model can be displayed correctly across different locales without changing the underlying data.
65
+
66
+
### OM Core preset expressions
67
+
68
+
A preset expression is a higher-level, readable directive that the engine maps to a concrete format. Presets are useful when you want explicit control over decimals, grouping, negative numbers, and zero display without writing a raw CLDR pattern:
Copy file name to clipboardExpand all lines: docs/reference/scripting.md
+44-11Lines changed: 44 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,28 @@ OM Core scripts use the `.openm` extension. They are executed inside the OM Core
4
4
5
5
## Run a script
6
6
7
-
Start OM Core and source the script file:
7
+
For a single-terminal workflow, start the TUI and source the script directly:
8
8
9
9
```bash
10
-
# Start the engine
10
+
./start.sh --tui
11
+
```
12
+
13
+
Then run the script inside the REPL:
14
+
15
+
```text
16
+
om> source scripts/build_financial_model.openm
17
+
```
18
+
19
+
For a multi-process workflow, use two terminals:
20
+
21
+
```bash
22
+
# Terminal 1 — start the engine
11
23
./start.sh --runtime
24
+
```
12
25
13
-
# ... run commands in repl mode ...
26
+
```bash
27
+
# Terminal 2 — connect a client
14
28
./start.sh --tui
15
-
om>source scripts/build_financial_model.openm
16
29
```
17
30
18
31
You can also run specific runtime modes directly:
@@ -23,8 +36,6 @@ You can also run specific runtime modes directly:
23
36
./start.sh --tui # terminal interface
24
37
```
25
38
26
-
`--runtime` starts the engine alone. In a multi-process setup, start `--runtime` in one terminal, then connect a client such as `--tui` or `--gui` in another. For a single-terminal workflow, use `--tui` after launching the engine via `--runtime` or the default `./start.sh`.
27
-
28
39
## First two commands
29
40
30
41
Once the REPL or TUI is running, start with `help` to see all documented commands.
@@ -58,7 +69,7 @@ dim Year --seq Y1 Y2 Y3 Y4 Y5
58
69
59
70
## Script structure
60
71
61
-
A typical`.openm` script follows this order:
72
+
A small`.openm` script can follow this order:
62
73
63
74
1. Define dimensions
64
75
2. Define cubes
@@ -67,6 +78,23 @@ A typical `.openm` script follows this order:
67
78
5. Calculate
68
79
6. Assert or save
69
80
81
+
For model bundles, use the numbered structure shown in the agent skill:
82
+
83
+
```text
84
+
00_variables
85
+
01_dimensions
86
+
02_cubes
87
+
03_inputs
88
+
04_rules
89
+
05_checks
90
+
06_views
91
+
07_formatting
92
+
08_groups
93
+
build.openm
94
+
```
95
+
96
+
`build.openm` sources the other files in order and then runs `calc`. Tiny one-file scripts may use a simpler order.
Visual styling is applied through rule channels, not through a separate formatting command. The channel determines which property the rule sets.
270
298
271
-
OM Core stores values and presentation attributes in channels. The default value channel is `@.value` and is implied when no channel is specified. Style channels change only the appearance:
299
+
OM Core stores values and presentation attributes in channels. The default value channel is `@.value` and is implied when no channel is specified. Style and format channels change only the appearance:
272
300
301
+
-`@.value` — the default value channel (implied when no channel is given)
302
+
-`@.format_number` — number or currency display format
273
303
-`@.fill` — the background fill color
274
304
-`@.font_color` — the font color
305
+
-`@.font_weight` — the font weight (e.g. `700` for bold)
Style rules follow the same semantic addressing as value rules. A single semantic address can have both a value rule and multiple style rules.
316
+
Style and format rules follow the same semantic addressing as value rules. A single semantic address can have both a value rule and multiple style rules.
284
317
285
318
### Number formatting
286
319
287
-
For number and currency display patterns, OM Core uses CLDR-style format strings. See [Formatting](formatting.md).
320
+
For number and currency display patterns, OM Core supports both CLDR-style patterns and OM Core preset expressions. See [Formatting](formatting.md).
Copy file name to clipboardExpand all lines: docs/skills/om-core-financial-modeling/SKILLS.md
+16-20Lines changed: 16 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,12 +77,12 @@ Use variables to avoid repeating important names.
77
77
Example:
78
78
79
79
```openm
80
-
var model_name = "SaaS Revenue Model"
81
-
var pl_cube = PL
82
-
var account_dim = Account
83
-
var month_dim = Month
84
-
var scenario_dim = Scenario
85
-
var base_scenario = Base
80
+
model_name="SaaS Revenue Model"
81
+
pl_cube="PL"
82
+
account_dim="Account"
83
+
month_dim="Month"
84
+
scenario_dim="Scenario"
85
+
base_scenario="Base"
86
86
```
87
87
88
88
Use `{{...}}` macro expansion to compose commands:
@@ -101,7 +101,7 @@ Use macro expansion for:
101
101
* reusable script templates
102
102
* model variants
103
103
104
-
Avoid using macro expansion to hide business logic. Rules should remain readable after expansion.
104
+
Avoid using macro expansion to hide business logic. Rules should remain readable after expansion. In concrete example bundles, variables are typically used for cube and dimension declarations, while cube names in rules and views may be hardcoded for readability. Reserve full macro saturation for reusable templates and model variants.
0 commit comments