Skip to content

Commit

Permalink
@ralfhandl's suggestion (slightly adapted)
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Jan 15, 2025
1 parent f7059d6 commit e51acaa
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
12 changes: 6 additions & 6 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=[{\"D\":[\"Country\"],\"A\":[\"CountryName\"]},\n {\"D\":[\"Region\"],\"A\":[\"RegionName\"]},\n {\"D\":[\"Segment\",\"Industry\"],\"A\":[]}],\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\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 Down Expand Up @@ -231,14 +231,14 @@
"$Kind": "ComplexType",
"@Common.Experimental": true,
"@Core.Description": "Property names constituting a level in an [unnamed leveled hierarchy](#MultiLevelExpand)",
"@Core.LongDescription": "Properties in `D` must be used to identify entries in [`ExpandEntries/Entry`](#MultiLevelExpandEntry),\n otherwise they have the same effect as properties in `A`.",
"D": {
"@Core.LongDescription": "`DimensionProperties` must be used to identify entries in [`ExpandEntries/Entry`](#MultiLevelExpandEntry),\n otherwise they have the same effect as `AdditionalProperties`.",
"DimensionProperties": {
"$Collection": true,
"@Core.Description": "A non-empty set of property names that define a combination of dimension values"
},
"A": {
"AdditionalProperties": {
"$Collection": true,
"@Core.Description": "A possibly empty set of names of additional properties of the dimensions that occur in `D`"
"@Core.Description": "A possibly empty set of names of additional properties of the dimensions that occur in `DimensionProperties`"
}
},
"MultiLevelExpandSiblingOrder": {
Expand All @@ -258,7 +258,7 @@
"@Core.Description": "Expansion state of an entry in an [unnamed leveled hierarchy](#MultiLevelExpand)",
"Entry": {
"$Collection": true,
"@Core.Description": "An entry on a given [level](#MultiLevelExpandLevel) is identified by a collection of values for the `D` properties that constitute all levels up to and including the given one"
"@Core.Description": "An entry on a given [level](#MultiLevelExpandLevel) is identified by a collection of values for the `DimensionProperties` that constitute all levels up to and including the given one"
},
"Levels": {
"$Type": "Edm.Int64",
Expand Down
16 changes: 8 additions & 8 deletions vocabularies/Analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ $apply=filter(Industry in ('IT','AI'))
/aggregate($count as LeavesCount),
aggregate(Amount,Currency),
Analytics.MultiLevelExpand(
Levels=[{"D":["Country"],"A":["CountryName"]},
{"D":["Region"],"A":["RegionName"]},
{"D":["Segment","Industry"],"A":[]}],
Levels=[{"DimensionProperties":["Country"],"AdditionalProperties":["CountryName"]},
{"DimensionProperties":["Region"],"AdditionalProperties":["RegionName"]},
{"DimensionProperties":["Segment","Industry"],"AdditionalProperties":[]}],
Aggregation=["Amount","Currency"],
SiblingOrder=[{"Property":"Amount","Descending":true}],
ShowLevels=2,
Expand Down Expand Up @@ -96,13 +96,13 @@ Property|Type|Description
## [MultiLevelExpandLevel](Analytics.xml#L265) *([Experimental](Common.md#Experimental))*
Property names constituting a level in an [unnamed leveled hierarchy](#MultiLevelExpand)

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

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

<a name="MultiLevelExpandSiblingOrder"></a>
## [MultiLevelExpandSiblingOrder](Analytics.xml#L279) *([Experimental](Common.md#Experimental))*
Expand All @@ -119,5 +119,5 @@ Expansion state of an entry in an [unnamed leveled hierarchy](#MultiLevelExpand)

Property|Type|Description
:-------|:---|:----------
[Entry](Analytics.xml#L292)|\[String\]|An entry on a given [level](#MultiLevelExpandLevel) is identified by a collection of values for the `D` properties that constitute all levels up to and including the given one
[Entry](Analytics.xml#L292)|\[String\]|An entry on a given [level](#MultiLevelExpandLevel) is identified by a collection of values for the `DimensionProperties` that constitute all levels up to and including the given one
[Levels](Analytics.xml#L295)|Int64?|Number of levels to be expanded, null means all levels, 0 means collapsed
18 changes: 9 additions & 9 deletions vocabularies/Analytics.xml
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ $apply=filter(Industry in ('IT','AI'))
/aggregate($count as LeavesCount),
aggregate(Amount,Currency),
Analytics.MultiLevelExpand(
Levels=[{"D":["Country"],"A":["CountryName"]},
{"D":["Region"],"A":["RegionName"]},
{"D":["Segment","Industry"],"A":[]}],
Levels=[{"DimensionProperties":["Country"],"AdditionalProperties":["CountryName"]},
{"DimensionProperties":["Region"],"AdditionalProperties":["RegionName"]},
{"DimensionProperties":["Segment","Industry"],"AdditionalProperties":[]}],
Aggregation=["Amount","Currency"],
SiblingOrder=[{"Property":"Amount","Descending":true}],
ShowLevels=2,
Expand Down Expand Up @@ -266,14 +266,14 @@ $apply=filter(Industry in ('IT','AI'))
<Annotation Term="Common.Experimental" />
<Annotation Term="Core.Description" String="Property names constituting a level in an [unnamed leveled hierarchy](#MultiLevelExpand)" />
<Annotation Term="Core.LongDescription">
<String>Properties in `D` must be used to identify entries in [`ExpandEntries/Entry`](#MultiLevelExpandEntry),
otherwise they have the same effect as properties in `A`.</String>
<String>`DimensionProperties` must be used to identify entries in [`ExpandEntries/Entry`](#MultiLevelExpandEntry),
otherwise they have the same effect as `AdditionalProperties`.</String>
</Annotation>
<Property Name="D" Type="Collection(Edm.String)" Nullable="false">
<Property Name="DimensionProperties" Type="Collection(Edm.String)" Nullable="false">
<Annotation Term="Core.Description" String="A non-empty set of property names that define a combination of dimension values" />
</Property>
<Property Name="A" Type="Collection(Edm.String)" Nullable="false">
<Annotation Term="Core.Description" String="A possibly empty set of names of additional properties of the dimensions that occur in `D`" />
<Property Name="AdditionalProperties" Type="Collection(Edm.String)" Nullable="false">
<Annotation Term="Core.Description" String="A possibly empty set of names of additional properties of the dimensions that occur in `DimensionProperties`" />
</Property>
</ComplexType>
<ComplexType Name="MultiLevelExpandSiblingOrder">
Expand All @@ -290,7 +290,7 @@ $apply=filter(Industry in ('IT','AI'))
<Annotation Term="Common.Experimental" />
<Annotation Term="Core.Description" String="Expansion state of an entry in an [unnamed leveled hierarchy](#MultiLevelExpand)" />
<Property Name="Entry" Type="Collection(Edm.String)" Nullable="false">
<Annotation Term="Core.Description" String="An entry on a given [level](#MultiLevelExpandLevel) is identified by a collection of values for the `D` properties that constitute all levels up to and including the given one" />
<Annotation Term="Core.Description" String="An entry on a given [level](#MultiLevelExpandLevel) is identified by a collection of values for the `DimensionProperties` that constitute all levels up to and including the given one" />
</Property>
<Property Name="Levels" Type="Edm.Int64" Nullable="true">
<Annotation Term="Core.Description" String="Number of levels to be expanded, null means all levels, 0 means collapsed" />
Expand Down

0 comments on commit e51acaa

Please sign in to comment.