Skip to content

Commit

Permalink
You can never be explicit enough
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Feb 21, 2025
1 parent 0ae8299 commit 20ee029
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
4 changes: 2 additions & 2 deletions vocabularies/Analytics.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
"$IsBound": true,
"@Common.Experimental": true,
"@Core.Description": "`$apply` transformation that expands an unnamed leveled hierarchy with custom aggregation of certain properties",
"@Core.LongDescription": "Example transformation sequence:\nfilter on columns `Industry`, `Amount` and `Currency`,\norder by `Amount` descending,\nshow 2 levels, with two exceptions\n```\n$apply=filter(Industry in ('IT','AI'))\n/groupby((Country,Region,Segment,Industry),\n filter($these/aggregate(Amount) gt 0 and\n $these/aggregate(Currency) ne null))\n/concat(\n groupby((Country,Region,Segment,Industry))\n /aggregate($count as LeavesCount),\n aggregate(Amount,Currency),\n Analytics.MultiLevelExpand(\n Levels=[{\"DimensionProperties\":[\"Country\"],\"AdditionalProperties\":[\"CountryName\"]},\n {\"DimensionProperties\":[\"Region\"],\"AdditionalProperties\":[\"RegionName\"]},\n {\"DimensionProperties\":[\"Segment\",\"Industry\"],\"AdditionalProperties\":[]}],\n Aggregation=[\"Amount\",\"Currency\"],\n SiblingOrder=[{\"Property\":\"Amount\",\"Descending\":true}],\n ShowLevels=2,\n ExpandEntries=[{\"Entry\":[\"US\"],\"Levels\":0},\n {\"Entry\":[\"DE\",\"BW\"],\"Levels\":1}]\n )/concat(aggregate($count as ResultEntriesCount),\n skip(20)/top(10)))\n```\n",
"@Core.LongDescription": "Example transformation sequence:\nfilter on columns `Industry`, `Amount` and `Currency`,\norder by `Amount` descending,\nshow 2 levels, with two exceptions\npreceded by one row with a leaves count and one row with the grand total\n```\n$apply=filter(Industry in ('IT','AI'))\n/groupby((Country,Region,Segment,Industry),\n filter($these/aggregate(Amount) gt 0 and\n $these/aggregate(Currency) ne null))\n/concat(\n groupby((Country,Region,Segment,Industry))\n /aggregate($count as LeavesCount),\n aggregate(Amount,Currency),\n Analytics.MultiLevelExpand(\n Levels=[{\"DimensionProperties\":[\"Country\"],\"AdditionalProperties\":[\"CountryName\"]},\n {\"DimensionProperties\":[\"Region\"],\"AdditionalProperties\":[\"RegionName\"]},\n {\"DimensionProperties\":[\"Segment\",\"Industry\"],\"AdditionalProperties\":[]}],\n Aggregation=[\"Amount\",\"Currency\"],\n SiblingOrder=[{\"Property\":\"Amount\",\"Descending\":true}],\n ShowLevels=2,\n ExpandEntries=[{\"Entry\":[\"US\"],\"Levels\":0},\n {\"Entry\":[\"DE\",\"BW\"],\"Levels\":1}]\n )/concat(aggregate($count as ResultEntriesCount),\n skip(20)/top(10)))\n```\n",
"$Parameter": [
{
"$Name": "InputSet",
Expand All @@ -185,7 +185,7 @@
"$Collection": true,
"$Type": "Analytics.MultiLevelExpandLevel",
"@Core.Description": "Collection of aggregation levels forming a leveled hierarchy",
"@Core.LongDescription": "Each element in the collection defines the properties that constitute one level.\n A property must not be referenced by more than one level.\n The first element in the collection defines the property names of the coarsest level,\n the following elements define the property names of consecutively finer-grained aggregation levels.\n The function result is the leveled hierarchy with these levels in preorder,\n entries on the finest-grained level cannot be expanded further.\n All referenced properties must be groupable."
"@Core.LongDescription": "Each element in the collection defines the properties that constitute one level.\n A property must not be referenced by more than one level.\n The first element in the collection defines the property names of the coarsest level,\n the following elements define the property names of consecutively finer-grained aggregation levels.\n The function result is the leveled hierarchy with these levels in preorder,\n entries on the finest-grained level cannot be expanded further.\n The result of this function does not contain a level representing a root or grand total.\n All referenced properties must be groupable."
},
{
"$Name": "Aggregation",
Expand Down
37 changes: 19 additions & 18 deletions vocabularies/Analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Term|Type|Description
[AggregatedProperties](Analytics.xml#L106) *(Deprecated)*|\[[AggregatedPropertyType](#AggregatedPropertyType)\]|<a name="AggregatedProperties"></a>Deprecated in favor of [`AggregatedProperty`](#AggregatedProperty)
[AggregatedProperty](Analytics.xml#L124)|[AggregatedPropertyType](#AggregatedPropertyType)|<a name="AggregatedProperty"></a>Dynamic property for aggregate expression with specified aggregation method defined on the annotated entity type.
[AnalyticalContext](Analytics.xml#L144)|\[[AnalyticalContextType](#AnalyticalContextType)\]|<a name="AnalyticalContext"></a>Collection of properties that define an analytical context
[LevelInformation](Analytics.xml#L307) *([Experimental](Common.md#Experimental))*|[HierarchyType](Hierarchy.md#HierarchyType)|<a name="LevelInformation"></a>Information about grouping levels in the result set of a request including the [`MultiLevelExpand`](#MultiLevelExpand) transformation
[LevelInformation](Analytics.xml#L309) *([Experimental](Common.md#Experimental))*|[HierarchyType](Hierarchy.md#HierarchyType)|<a name="LevelInformation"></a>Information about grouping levels in the result set of a request including the [`MultiLevelExpand`](#MultiLevelExpand) transformation


## Functions
Expand All @@ -31,6 +31,7 @@ Example transformation sequence:
filter on columns `Industry`, `Amount` and `Currency`,
order by `Amount` descending,
show 2 levels, with two exceptions
preceded by one row with a leaves count and one row with the grand total
```
$apply=filter(Industry in ('IT','AI'))
/groupby((Country,Region,Segment,Industry),
Expand All @@ -56,14 +57,14 @@ $apply=filter(Industry in ('IT','AI'))

Parameter|Type|Description
:--------|:---|:----------
**[InputSet](Analytics.xml#L213)**|\[EntityType\]|**Binding parameter:** Entity set to be processed
[Levels](Analytics.xml#L216)|\[[MultiLevelExpandLevel](#MultiLevelExpandLevel)\]|Collection of aggregation levels forming a leveled hierarchy<br>Each element in the collection defines the properties that constitute one level. A property must not be referenced by more than one level. The first element in the collection defines the property names of the coarsest level, the following elements define the property names of consecutively finer-grained aggregation levels. The function result is the leveled hierarchy with these levels in preorder, entries on the finest-grained level cannot be expanded further. All referenced properties must be groupable.
[Aggregation](Analytics.xml#L228)|\[String\]|Properties to aggregate for all result entries on all levels<br>All properties in this collection must be custom aggregates.
[SiblingOrder](Analytics.xml#L234)|\[[MultiLevelExpandSiblingOrder](#MultiLevelExpandSiblingOrder)\]|Sort specification to apply to all direct descendants of a given entry (so-called siblings) in the resulting leveled hierarchy
*[ShowLevels](Analytics.xml#L237)*|Int64|*Optional parameter:* Number N of levels to be shown in the initial expansion<br>The initial expansion shows the first N levels as defined in `Levels` (0 ≤ N ≤ length of `Levels`). If this parameter is omitted, all levels are shown.
*[ExpandEntries](Analytics.xml#L247)*|\[[MultiLevelExpandEntry](#MultiLevelExpandEntry)\]|*Optional parameter:* Entries with exceptional expansion
*[SubtotalsAtBottom](Analytics.xml#L253)*|Bool|*Optional parameter:* Whether to duplicate the group headers so that they appear before and after their descendants<br>The entry before has [DrillState](Hierarchy.md#HierarchyType) `expanded`, the entry after has DrillState `subtotal`.
[&rarr;](Analytics.xml#L265)|\[EntityType\]|Output set including the instance annotation [`LevelInformation`](#LevelInformation)
**[InputSet](Analytics.xml#L214)**|\[EntityType\]|**Binding parameter:** Entity set to be processed
[Levels](Analytics.xml#L217)|\[[MultiLevelExpandLevel](#MultiLevelExpandLevel)\]|Collection of aggregation levels forming a leveled hierarchy<br>Each element in the collection defines the properties that constitute one level. A property must not be referenced by more than one level. The first element in the collection defines the property names of the coarsest level, the following elements define the property names of consecutively finer-grained aggregation levels. The function result is the leveled hierarchy with these levels in preorder, entries on the finest-grained level cannot be expanded further. The result of this function does not contain a level representing a root or grand total. All referenced properties must be groupable.
[Aggregation](Analytics.xml#L230)|\[String\]|Properties to aggregate for all result entries on all levels<br>All properties in this collection must be custom aggregates.
[SiblingOrder](Analytics.xml#L236)|\[[MultiLevelExpandSiblingOrder](#MultiLevelExpandSiblingOrder)\]|Sort specification to apply to all direct descendants of a given entry (so-called siblings) in the resulting leveled hierarchy
*[ShowLevels](Analytics.xml#L239)*|Int64|*Optional parameter:* Number N of levels to be shown in the initial expansion<br>The initial expansion shows the first N levels as defined in `Levels` (0 ≤ N ≤ length of `Levels`). If this parameter is omitted, all levels are shown.
*[ExpandEntries](Analytics.xml#L249)*|\[[MultiLevelExpandEntry](#MultiLevelExpandEntry)\]|*Optional parameter:* Entries with exceptional expansion
*[SubtotalsAtBottom](Analytics.xml#L255)*|Bool|*Optional parameter:* Whether to duplicate the group headers so that they appear before and after their descendants<br>The entry before has [DrillState](Hierarchy.md#HierarchyType) `expanded`, the entry after has DrillState `subtotal`.
[&rarr;](Analytics.xml#L267)|\[EntityType\]|Output set including the instance annotation [`LevelInformation`](#LevelInformation)


<a name="AggregatedPropertyType"></a>
Expand Down Expand Up @@ -93,31 +94,31 @@ Property|Type|Description
[AccumulativeMeasure](Analytics.xml#L168)|[Tag](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#Tag)|The measure has non-negative and additive values; it can be used in whole-part charts, e.g. the Donut

<a name="MultiLevelExpandLevel"></a>
## [MultiLevelExpandLevel](Analytics.xml#L269) *([Experimental](Common.md#Experimental))*
## [MultiLevelExpandLevel](Analytics.xml#L271) *([Experimental](Common.md#Experimental))*
Property names constituting a level in an [unnamed leveled hierarchy](#MultiLevelExpand)

`DimensionProperties` must be used to identify entries in [`ExpandEntries/Entry`](#MultiLevelExpandEntry),
otherwise they have the same effect as `AdditionalProperties`.

Property|Type|Description
:-------|:---|:----------
[DimensionProperties](Analytics.xml#L276)|\[String\]|A non-empty list of property names that define a combination of dimension values
[AdditionalProperties](Analytics.xml#L279)|\[String\]|A possibly empty list of names of additional properties of the dimensions that occur in `DimensionProperties`
[DimensionProperties](Analytics.xml#L278)|\[String\]|A non-empty list of property names that define a combination of dimension values
[AdditionalProperties](Analytics.xml#L281)|\[String\]|A possibly empty list of names of additional properties of the dimensions that occur in `DimensionProperties`

<a name="MultiLevelExpandSiblingOrder"></a>
## [MultiLevelExpandSiblingOrder](Analytics.xml#L283) *([Experimental](Common.md#Experimental))*
## [MultiLevelExpandSiblingOrder](Analytics.xml#L285) *([Experimental](Common.md#Experimental))*
Sibling order in an [unnamed leveled hierarchy](#MultiLevelExpand)

Property|Type|Description
:-------|:---|:----------
[Property](Analytics.xml#L286)|String|Property by which to sort
[Descending](Analytics.xml#L289)|Boolean?|Sort direction, ascending if not specified otherwise
[Property](Analytics.xml#L288)|String|Property by which to sort
[Descending](Analytics.xml#L291)|Boolean?|Sort direction, ascending if not specified otherwise

<a name="MultiLevelExpandEntry"></a>
## [MultiLevelExpandEntry](Analytics.xml#L293) *([Experimental](Common.md#Experimental))*
## [MultiLevelExpandEntry](Analytics.xml#L295) *([Experimental](Common.md#Experimental))*
Expansion state of an entry in an [unnamed leveled hierarchy](#MultiLevelExpand)

Property|Type|Description
:-------|:---|:----------
[Entry](Analytics.xml#L296)|\[String\]|An entry on a given [level](#MultiLevelExpandLevel) is identified by a list of values for the `DimensionProperties` that constitute all levels up to and including the given one<br>The values are cast to strings as in the OData `cast` function.
[Levels](Analytics.xml#L302)|Int64?|Number of levels to be expanded, null means all levels, 0 means collapsed
[Entry](Analytics.xml#L298)|\[String\]|An entry on a given [level](#MultiLevelExpandLevel) is identified by a list of values for the `DimensionProperties` that constitute all levels up to and including the given one<br>The values are cast to strings as in the OData `cast` function.
[Levels](Analytics.xml#L304)|Int64?|Number of levels to be expanded, null means all levels, 0 means collapsed
2 changes: 2 additions & 0 deletions vocabularies/Analytics.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
filter on columns `Industry`, `Amount` and `Currency`,
order by `Amount` descending,
show 2 levels, with two exceptions
preceded by one row with a leaves count and one row with the grand total
```
$apply=filter(Industry in ('IT','AI'))
/groupby((Country,Region,Segment,Industry),
Expand Down Expand Up @@ -222,6 +223,7 @@ $apply=filter(Industry in ('IT','AI'))
the following elements define the property names of consecutively finer-grained aggregation levels.
The function result is the leveled hierarchy with these levels in preorder,
entries on the finest-grained level cannot be expanded further.
The result of this function does not contain a level representing a root or grand total.
All referenced properties must be groupable.</String>
</Annotation>
</Parameter>
Expand Down

0 comments on commit 20ee029

Please sign in to comment.