Skip to content

Commit e06e2c7

Browse files
Merge branch 'main' of github.com:semanticdatalayer/SML into ATSCALE-26920-calc-group-and-member-doc
2 parents 481862c + b2b86d6 commit e06e2c7

File tree

2 files changed

+64
-20
lines changed

2 files changed

+64
-20
lines changed

sml-reference/dimension.md

Lines changed: 61 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ SML supports the following types of dimensions:
2929

3030
Sample `dimension` file:
3131

32-
```
32+
```yaml
3333
unique_name: Store Dimension
3434
object_type: dimension
3535
label: Store Dimension
@@ -154,11 +154,14 @@ classDiagram
154154
Dimension *-- Hierarchy
155155
Dimension *-- LevelAttribute
156156
Dimension *-- CalculationGroup
157+
Hierarchy *-- DefaultMember
157158
Hierarchy *-- Level
158159
LevelAttribute *-- CustomEmptyMember
160+
LevelAttribute *-- SharedDegenerateColumns
159161
Level *-- SecondaryAttribute
160162
Level *-- MetricalAttribute
161163
Level *-- Alias
164+
Level *-- ParallelPeriods
162165
CalculationGroup *-- CalculatedMembers
163166
SecondaryAttribute *-- CustomEmptyMember
164167
Alias *-- CustomEmptyMember
@@ -182,11 +185,12 @@ namespace Dimensions{
182185
Object to
183186
String role_play
184187
String type
185-
Boolean m2m
186188
}
187189
class From{
188190
String dataset
189-
Array~Column~ columns
191+
Array~String~ join_columns
192+
String hierarchy
193+
String level
190194
}
191195
class To{
192196
String dimension
@@ -196,17 +200,22 @@ namespace Dimensions{
196200
class Hierarchy{
197201
String unique_name
198202
String label
203+
String description
199204
String folder
200205
enum filter_empty
206+
DefaultMember default_member
201207
Array~Level~ levels
202208
}
209+
class DefaultMember{
210+
String expression
211+
Boolean apply_only_when_in_query
212+
}
203213
class Level{
204214
String unique_name
205-
String description
206215
Array~SecondaryAttribute~ secondary_attributes
207216
Array~Alias~ aliases
208217
Array~MetricalAttribute~ metrics
209-
String default_member
218+
Array~ParallelPeriods~ parallel_periods
210219
Boolean is_hidden
211220
}
212221
class Alias{
@@ -218,11 +227,11 @@ namespace Dimensions{
218227
String sort_column
219228
String folder
220229
Boolean is_hidden
230+
String format
221231
Boolean exclude_from_dim_agg
232+
Boolean is_aggregatable
222233
Boolean exclude_from_fact_agg
223234
Array~CustomEmptyMember~ custom_empty_member
224-
Array~String~ allowed_calcs_for_dma
225-
Object role
226235
}
227236
class MetricalAttribute{
228237
String unique_name
@@ -235,11 +244,16 @@ namespace Dimensions{
235244
String column
236245
Boolean is_hidden
237246
Boolean exclude_from_dim_agg
247+
Boolean is_aggregatable
238248
Boolean exclude_from_fact_agg
239249
CustomEmptyMember custom_empty_member
240250
enum unrelated_dimensions_handling
241251
Array~String~ allowed_calcs_for_dma
242252
}
253+
class ParallelPeriods{
254+
String level
255+
Array~String~ key_columns
256+
}
243257
class LevelAttribute{
244258
String unique_name
245259
String label
@@ -252,9 +266,20 @@ namespace Dimensions{
252266
Boolean is_hidden
253267
Boolean is_unique_key
254268
Boolean exclude_from_dim_agg
269+
Boolean is_aggregatable
255270
Boolean exclude_from_fact_agg
256271
String time_unit
257272
Array~String~ allowed_calcs_for_dma
273+
CustomEmptyMember custom_empty_member
274+
String folder
275+
Array~SharedDegenerateColumns~ shared_degenerate_columns
276+
}
277+
class SharedDegenerateColumns {
278+
String dataset
279+
String name_column
280+
String sort_column
281+
Array~String~ key_columns
282+
Boolean is_unique_key
258283
}
259284
class SecondaryAttribute{
260285
String unique_name
@@ -266,9 +291,12 @@ namespace Dimensions{
266291
String sort_column
267292
Array~String~ key_columns
268293
Boolean exclude_from_dim_agg
294+
Boolean is_aggregatable
269295
Boolean exclude_from_fact_agg
270296
Array~String~ allowed_calcs_for_dma
271-
Array~CustomEmptyMember~ custom_empty_member
297+
CustomEmptyMember custom_empty_member
298+
Boolean is_hidden
299+
Boolean contains_unique_names
272300
}
273301
class CustomEmptyMember{
274302
Array~String~ key
@@ -290,6 +318,7 @@ namespace Dimensions{
290318
Boolean is_hidden
291319
String expression
292320
Boolean use_input_metric_format
321+
String template
293322
}
294323
}
295324
```
@@ -327,14 +356,6 @@ need to be unique.
327356

328357
A description of the dimension.
329358

330-
## folder
331-
332-
- **Type:** string
333-
- **Required:** N
334-
335-
The name of the folder in which the calculation group appears in BI
336-
tools.
337-
338359
## type
339360

340361
- **Type:** enum
@@ -347,6 +368,13 @@ Supported values:
347368
- `standard`: Can have any type of hierarchy.
348369
- `time`: Must have a time hierarchy.
349370

371+
## is_degenerate
372+
373+
- **Type:** boolean
374+
- **Required:** N
375+
376+
Determines whether the dimension is degenerate.
377+
350378
## hierarchies
351379

352380
- **Type:** array
@@ -527,6 +555,13 @@ Supported values:
527555
- `false` (default)
528556
- `true`
529557

558+
## folder
559+
560+
- **Type:** string
561+
- **Required:** N
562+
563+
The name of the folder in which the calculation group is displayed in BI tools.
564+
530565
# Calculated Members Properties
531566

532567
## unique_name
@@ -732,6 +767,13 @@ For levels in time dimensions only. Defines a custom parallel period for the lev
732767

733768
You can define as many parallel periods for a level as needed.
734769

770+
## is_hidden
771+
772+
- **Type:** boolean
773+
- **Required:** N
774+
775+
Determines whether the level is visible in BI tools.
776+
735777
# Secondary Attributes Properties
736778

737779
## unique_name
@@ -844,7 +886,7 @@ Excludes this attribute from system generated fact-based aggregates. This is use
844886

845887
## custom\_empty\_member
846888

847-
- **Type:** array
889+
- **Type:** object
848890
- **Required:** N
849891

850892
Defines a custom empty member for the attribute. This feature allows fact data with missing or invalid foreign key values to be isolated and independently aggregated from those with valid foreign key values. Because fact records with invalid foreign keys are aggregated separately from records referencing valid dimension members, analysts can easily spot data integrity problems and further investigate them. Use this feature to ensure that un-joinable values are included in query results and aggregated under a specially designated dimension member called the Custom Empty Member.
@@ -1202,7 +1244,7 @@ Supported properties:
12021244

12031245
For example:
12041246

1205-
```
1247+
```yaml
12061248
level_attributes:
12071249

12081250
- unique_name: Order Degen Shared Level
@@ -1361,7 +1403,7 @@ A list of the empty member values to use for key fields.
13611403

13621404
The empty member value to use for name fields.
13631405

1364-
## sort
1406+
## sort_name
13651407

13661408
- **Type:** string
13671409
- **Required:** N

sml-reference/metric.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,13 @@ Defines the metric as a semi-additive metric.
148148
- **Type:** string
149149
- **Required:** Y
150150

151-
Determines whether the metric is First Non-Empty or Last Non-Empty.
151+
Determines whether the metric is First Non-Empty, Last Non-Empty, First Child or Last Child.
152152

153153
Supported values:
154154
- `first`
155155
- `last`
156+
- `first_child` - introduced in version `1.1`
157+
- `last_child` - introduced in version `1.1`
156158

157159
### relationships
158160

0 commit comments

Comments
 (0)