Skip to content

Commit cc7a71d

Browse files
committed
docs: Edits and fixes
1 parent 42c68da commit cc7a71d

File tree

5 files changed

+36
-52
lines changed

5 files changed

+36
-52
lines changed

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

Lines changed: 11 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ 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+
### Measure format
57+
58+
The MDX API respects the [`format` parameter][ref-measure-format] of measures so that the
59+
values are displayed accordingly in Excel, i.e., `percent` formats values as percentages
60+
and `currency` formats values as monetary values.
61+
62+
Currency formatting is locale-aware and responds to the language configuration set via
63+
the `CUBE_XMLA_LANGUAGE` environment variable.
64+
5665
## Using MDX API with Excel
5766

5867
<InfoBox>
@@ -180,59 +189,10 @@ This is going to be harmonized in the future.
180189
181190
</InfoBox>
182191
183-
## Formatting
184-
185-
MDX API supports formatting for measures to control how values are displayed in Excel.
186-
187-
### Percent format
188-
189-
You can format measures as percentages using the `percent` format type:
190-
191-
```yaml
192-
cubes:
193-
- name: orders
194-
sql_table: ORDERS
195-
196-
measures:
197-
- name: completion_rate
198-
sql: "COUNT(CASE WHEN {CUBE}.status = 'completed' THEN 1 END) / COUNT(*)"
199-
type: number
200-
format: percent
201-
```
202-
203-
### Currency format
204-
205-
You can format measures as currency using the `currency` format type:
206-
207-
```yaml
208-
cubes:
209-
- name: orders
210-
sql_table: ORDERS
211-
212-
measures:
213-
- name: total_revenue
214-
sql: "{CUBE}.amount"
215-
type: sum
216-
format: currency
217-
```
218-
219-
Currency formatting is locale-aware and responds to the language configuration set via the `CUBE_XMLA_LANGUAGE` environment variable. This variable accepts either [Microsoft LCID (Locale Identifier)][link-lcid] values or language tags. The default value is `1033` (English - United States).
220-
221-
For example, to display currency values using the Netherlands locale (Euro with comma as decimal separator), you can use either:
222-
223-
```bash
224-
# Using LCID
225-
CUBE_XMLA_LANGUAGE=1043
226-
227-
# Using language tag
228-
CUBE_XMLA_LANGUAGE=nl-NL
229-
```
230-
231192
## Authentication and authorization
232193
233194
Authentication and authorization work the same as for the [SQL API](/product/apis-integrations/sql-api/security).
234195
235-
[link-lcid]: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/70feba9f-294e-491e-b6eb-56532684c37f
236196
[ref-excel]: /product/configuration/visualization-tools/excel
237197
[link-mdx]: https://learn.microsoft.com/en-us/analysis-services/multidimensional-models/mdx/multidimensional-model-data-access-analysis-services-multidimensional-data?view=asallproducts-allversions#bkmk_querylang
238198
[link-pivottable]: https://support.microsoft.com/en-us/office/create-a-pivottable-to-analyze-worksheet-data-a9a84538-bfe9-40a9-a8e9-f99134456576
@@ -242,4 +202,5 @@ Authentication and authorization work the same as for the [SQL API](/product/api
242202
[ref-views]: /product/data-modeling/concepts#views
243203
[ref-deployment]: /product/deployment/cloud/deployments
244204
[ref-pre-aggregations]: /product/caching/using-pre-aggregations
245-
[ref-rollup-only-mode]: /product/caching/using-pre-aggregations#rollup-only-mode
205+
[ref-rollup-only-mode]: /product/caching/using-pre-aggregations#rollup-only-mode
206+
[ref-measure-format]: /product/data-modeling/reference/measures#format

docs/pages/product/caching/recipes/joining-multiple-data-sources.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ cubes:
7272

7373
joins:
7474
suppliers:
75-
sql: "{supplier_id} = ${suppliers.id}"
75+
sql: "{supplier_id} = {suppliers.id}"
7676
relationship: many_to_one
7777
```
7878

docs/pages/product/caching/using-pre-aggregations.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ This technique, together with multi-router Cube Store approach, allows you to ac
270270

271271
In general, it's better to lean towards less partitions, as long as you are satisfied with query speed.
272272

273-
For optimal _querying performance_, partitions should be small enough so that the Cube Store workers can process them in less than 100 milliseconds.
273+
For optimal _querying performance_, partitions should be small enough so that a Cube Store worker can read (scan) a partition in less than 100 milliseconds.
274274
The best way to optimize this is to start from a relatively large partition (e.g., yearly or no partition at all if data permits),
275275
check what the [flame graph][ref-flame-graph] in Query History shows, then iterate as needed.
276276

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,6 +1305,26 @@ If `true`, the DAX API will expose time dimensions as calendar hierarchies.
13051305
| --------------- | ---------------------- | --------------------- |
13061306
| `true`, `false` | `true` | `true` |
13071307

1308+
## `CUBE_XMLA_LANGUAGE`
1309+
1310+
This variable is used to [configure the locale][ref-mdx-api-locale] for the [MDX API][ref-mdx-api].
1311+
1312+
| Possible Values | Default in Development | Default in Production |
1313+
| --------------- | ---------------------- | --------------------- |
1314+
| Either a [LCID][link-lcid] (numeric) or a language tag (string) | `1033` (English - United States) | `1033` (English - United States) |
1315+
1316+
For example, to display currency values using the Netherlands locale (euro with comma as decimal separator), you can use either:
1317+
1318+
```bash
1319+
# LCID
1320+
CUBE_XMLA_LANGUAGE=1043
1321+
1322+
# Language tag
1323+
CUBE_XMLA_LANGUAGE=nl-NL
1324+
```
1325+
1326+
[link-lcid]: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/70feba9f-294e-491e-b6eb-56532684c37f
1327+
13081328
## `CUBEJS_NESTED_FOLDERS_DELIMITER`
13091329

13101330
Specifies the delimiter used to flatten the names of nested [folder][ref-folders] in
@@ -1809,3 +1829,5 @@ The port for a Cube deployment to listen to API connections on.
18091829
[ref-dataviz-tools]: /product/configuration/visualization-tools
18101830
[ref-context-to-app-id]: /product/configuration/reference/config#context_to_app_id
18111831
[ref-environments]: /product/workspace/environments
1832+
[ref-mdx-api]: /product/apis-integrations/mdx-api
1833+
[ref-mdx-api-locale]: /product/apis-integrations/mdx-api#measure-format

docs/plugins/link-environment-variables.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const isCubeEnvVar = (value) => {
77
"CUBEJS_",
88
"CUBESTORE_",
99
"CUBESQL_",
10+
"CUBE_",
1011
]
1112

1213
return (

0 commit comments

Comments
 (0)