diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index a5c4790b8d037..05b2c1d49ef50 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -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 diff --git a/docs/pages/product/apis-integrations/mdx-api.mdx b/docs/pages/product/apis-integrations/mdx-api.mdx index 2ecb517c235d3..a663cceda8ea5 100644 --- a/docs/pages/product/apis-integrations/mdx-api.mdx +++ b/docs/pages/product/apis-integrations/mdx-api.mdx @@ -180,11 +180,59 @@ This is going to be harmonized in the future. +## 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