Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,10 @@ jobs:
contents: read
actions: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Install Codecov CLI
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
Expand Down
50 changes: 49 additions & 1 deletion docs/pages/product/apis-integrations/mdx-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,59 @@ This is going to be harmonized in the future.

</InfoBox>

## Formatting

MDX API supports formatting for measures to control how values are displayed in Excel.

### Percent format

You can format measures as percentages using the `percent` format type:

```yaml
cubes:
- name: orders
sql_table: ORDERS

measures:
- name: completion_rate
sql: "COUNT(CASE WHEN {CUBE}.status = 'completed' THEN 1 END) / COUNT(*)"
type: number
format: percent
```

### Currency format

You can format measures as currency using the `currency` format type:

```yaml
cubes:
- name: orders
sql_table: ORDERS

measures:
- name: total_revenue
sql: "{CUBE}.amount"
type: sum
format: currency
```

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).

For example, to display currency values using the Netherlands locale (Euro with comma as decimal separator), you can use either:

```bash
# Using LCID
CUBE_XMLA_LANGUAGE=1043

# Using language tag
CUBE_XMLA_LANGUAGE=nl-NL
```

## Authentication and authorization

Authentication and authorization work the same as for the [SQL API](/product/apis-integrations/sql-api/security).


[link-lcid]: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/70feba9f-294e-491e-b6eb-56532684c37f
[ref-excel]: /product/configuration/visualization-tools/excel
[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
[link-pivottable]: https://support.microsoft.com/en-us/office/create-a-pivottable-to-analyze-worksheet-data-a9a84538-bfe9-40a9-a8e9-f99134456576
Expand Down
Loading