Skip to content

Commit 8a67db4

Browse files
authored
docs(mdx): Date hierarchies (#10082)
1 parent 9a51a5a commit 8a67db4

File tree

2 files changed

+37
-5
lines changed

2 files changed

+37
-5
lines changed

docs/pages/product/apis-integrations/mdx-api.mdx

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,29 @@ directly to the upstream data source.
5353
- If some queries still go to the upstream data source, it should respond with a
5454
subsecond latency. Consider tuning the concurrency and quotas to achieve that.
5555

56+
### Date hierarchies
57+
58+
By default, the MDX API creates additional hierarchies for all [time dimensions][ref-time-dimensions] and organizing them in a separate folder called "Calendar" for each dimension.
59+
This creates a Calendar hierarchy structure containing `Year`, `Quarter`, `Month`, `Week`, and `Day` levels, as well as Calendar Quarter of Year and Calendar Year hierarchies.
60+
61+
```
62+
- Dimension Calendar:
63+
- Year
64+
- Quarter
65+
- Month
66+
- Week
67+
- Day
68+
- Dimension Calendar Quarter of Year:
69+
- Quarter
70+
- Dimension Calendar Year
71+
- Year
72+
```
73+
74+
These hierarchies are particularly useful in Excel because they allow you to filter your data without needing to drill down or expand all levels.
75+
Additionally, you can combine Calendar Year or Calendar Quarter of Year as filters while placing other dimensions on the axis.
76+
77+
You can set the `CUBE_MDX_CREATE_DATE_HIERARCHIES` environment variable to `false` to disable this behavior.
78+
5679
### Measure format
5780

5881
The MDX API respects the [`format` parameter][ref-measure-format] of measures so that the
@@ -94,7 +117,7 @@ views:
94117
95118
For historical reasons, the syntax shown above differ from how
96119
[hierarchies][ref-hierarchies] are supposed to be defined in the data model.
97-
This is going to be harmonized in the future.
120+
This is going to be harmonized in the future.
98121
99122
</InfoBox>
100123
@@ -185,7 +208,7 @@ views:
185208
186209
For historical reasons, the syntax shown above differ from how
187210
[folders][ref-folders] are supposed to be defined in the data model.
188-
This is going to be harmonized in the future.
211+
This is going to be harmonized in the future.
189212
190213
</InfoBox>
191214
@@ -203,4 +226,4 @@ Authentication and authorization work the same as for the [SQL API](/product/api
203226
[ref-deployment]: /product/deployment/cloud/deployments
204227
[ref-pre-aggregations]: /product/caching/using-pre-aggregations
205228
[ref-rollup-only-mode]: /product/caching/using-pre-aggregations#rollup-only-mode
206-
[ref-measure-format]: /product/data-modeling/reference/measures#format
229+
[ref-measure-format]: /product/data-modeling/reference/measures#format

docs/pages/product/configuration/reference/environment-variables.mdx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,7 @@ If `true`, the DAX API will expose time dimensions as calendar hierarchies.
13071307

13081308
## `CUBE_XMLA_LANGUAGE`
13091309

1310-
This variable is used to [configure the locale][ref-mdx-api-locale] for the [MDX API][ref-mdx-api].
1310+
This variable is used to [configure the locale][ref-mdx-api-locale] for the [MDX API][ref-mdx-api].
13111311

13121312
| Possible Values | Default in Development | Default in Production |
13131313
| --------------- | ---------------------- | --------------------- |
@@ -1325,6 +1325,14 @@ CUBE_XMLA_LANGUAGE=nl-NL
13251325

13261326
[link-lcid]: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/70feba9f-294e-491e-b6eb-56532684c37f
13271327

1328+
## `CUBE_MDX_CREATE_DATE_HIERARCHIES`
1329+
1330+
If `true`, the [MDX API][ref-mdx-api] will automatically create additional hierarchies for all [time dimensions][ref-time-dimensions] and organize them in a separate "Calendar" folder for each dimension.
1331+
1332+
| Possible Values | Default in Development | Default in Production |
1333+
| --------------- | ---------------------- | --------------------- |
1334+
| `true`, `false` | `true` | `true` |
1335+
13281336
## `CUBEJS_NESTED_FOLDERS_DELIMITER`
13291337

13301338
Specifies the delimiter used to flatten the names of nested [folder][ref-folders] in
@@ -1830,4 +1838,5 @@ The port for a Cube deployment to listen to API connections on.
18301838
[ref-context-to-app-id]: /product/configuration/reference/config#context_to_app_id
18311839
[ref-environments]: /product/workspace/environments
18321840
[ref-mdx-api]: /product/apis-integrations/mdx-api
1833-
[ref-mdx-api-locale]: /product/apis-integrations/mdx-api#measure-format
1841+
[ref-mdx-api-locale]: /product/apis-integrations/mdx-api#measure-format
1842+
[ref-time-dimensions]: /product/data-modeling/reference/dimensions#time

0 commit comments

Comments
 (0)