You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pages/product/apis-integrations/mdx-api.mdx
+49-1Lines changed: 49 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -180,11 +180,59 @@ This is going to be harmonized in the future.
180
180
181
181
</InfoBox>
182
182
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
+
183
231
## Authentication and authorization
184
232
185
233
Authentication and authorization work the same as for the [SQL API](/product/apis-integrations/sql-api/security).
0 commit comments