Skip to content

Commit 88e6c65

Browse files
authored
Update FFSQL cube/irr documentation (#56)
* update * update * update
1 parent 78af5ed commit 88e6c65

File tree

8 files changed

+2270
-1
lines changed

8 files changed

+2270
-1
lines changed

docs/common-workflows/analytics/manage-datasets/manage-cube-objects/create-a-cube-object.md

Lines changed: 504 additions & 0 deletions
Large diffs are not rendered by default.

docs/common-workflows/analytics/manage-datasets/manage-cube-objects/retrieve-a-cube-definition.md

Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,257 @@ You can view the cube’s definition in the body of the response.
182182

183183
Response Code: 200 (The cube’s definition was returned successfully.)
184184

185+
## Retrieve a FFSQL cube's definition
186+
187+
This workflow sample demonstrates how to retrieve the definition of a FFSQL cube through the Modeling service.
188+
189+
You want to get the definition of the `Year, Category Analysis` cube object. The object ID of the cube is `A7D792D54B58C6CB68F192A4A73E317F` in the MicroStrategy Tutorial project. The project ID is `B7CA92F04B9FAE8D941C3E9B7E0CD754`.
190+
191+
:::info
192+
193+
Get the authorization token needed to execute the request with [POST /api/auth/login](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Authentication/postLogin).
194+
195+
Get the project ID from [GET /api/projects](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Projects/getProjects_1).
196+
197+
:::
198+
199+
Retrieve the FFSQL cube’s definition using `GET /api/model/cubes/{cubeId}`.
200+
201+
Sample Request Header:
202+
203+
```http
204+
"accept": "application/json"
205+
"X-MSTR-AuthToken": "cs0intmf1fgij7ao0v2v0j48e5"
206+
"X-MSTR-ProjectID": "B7CA92F04B9FAE8D941C3E9B7E0CD754"
207+
```
208+
209+
Sample Request Body: Empty
210+
211+
Sample Curl:
212+
213+
```bash
214+
curl -X GET "https://demo.microstrategy.com/MicroStrategyLibrary/api/model/cubes/A7D792D54B58C6CB68F192A4A73E317F" \
215+
-H "accept: application/json" \
216+
-H "X-MSTR-AuthToken: cs0intmf1fgij7ao0v2v0j48e5" \
217+
-H "X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754"
218+
```
219+
220+
Sample Response Body:
221+
222+
You can view the cube’s definition in the body of the response.
223+
224+
```json
225+
{
226+
"information": {
227+
"dateCreated": "2022-03-17T22:47:26.514Z",
228+
"dateModified": "2022-03-18T20:13:47.091Z",
229+
"versionId": "59EB912782474BDB5706F8A1E70480D5",
230+
"primaryLocale": "en-US",
231+
"objectId": "A7D792D54B58C6CB68F192A4A73E317F",
232+
"subType": "report_cube",
233+
"name": "Year, Category Analysis"
234+
},
235+
"template": {
236+
"rows": [
237+
{
238+
"id": "FF816775FB784C75B3BA2B63BAECDE96",
239+
"name": "ffsqlIdV1",
240+
"type": "attribute",
241+
"forms": [
242+
{
243+
"id": "45C11FA478E745FEA08D781CEA190FE5",
244+
"name": "ID"
245+
}
246+
]
247+
},
248+
{
249+
"id": "FB045BB2C57D45488879EC303B76C129",
250+
"name": "ffsqlNameV1",
251+
"type": "attribute",
252+
"forms": [
253+
{
254+
"id": "45C11FA478E745FEA08D781CEA190FE5",
255+
"name": "ID"
256+
}
257+
]
258+
}
259+
],
260+
"columns": [
261+
{
262+
"type": "metrics",
263+
"elements": [
264+
{
265+
"id": "FA1A75DDC3BF4864932E8C20BF17801D",
266+
"name": "ffsqlAgeV1",
267+
"subType": "metric"
268+
},
269+
{
270+
"id": "398954E92D7D4395894DAC4B18E7B453",
271+
"name": "ffsqlScoreV1",
272+
"subType": "metric"
273+
}
274+
]
275+
}
276+
],
277+
"pageBy": []
278+
},
279+
"options": {
280+
"dataRefresh": "replace",
281+
"dataPartition": {
282+
"partitionAttribute": {},
283+
"numberOfPartitions": 0,
284+
"fetchDataSlicesInParallel": false
285+
}
286+
},
287+
"timeBased": {
288+
"timezone": null,
289+
"calendar": null,
290+
"enableTimezoneAndCalendarReporting": true
291+
},
292+
"sourceType": "custom_sql_free_form",
293+
"table": {
294+
"physicalTable": {
295+
"columns": [
296+
{
297+
"id": "186F0F9D63C94E12A129296F94970A7E",
298+
"name": "ffsqlIdV1",
299+
"dataType": {
300+
"type": "integer",
301+
"precision": 4,
302+
"scale": 0
303+
}
304+
},
305+
{
306+
"id": "E8F67F57C68B463390209166D5679F79",
307+
"name": "ffsqlNameV1",
308+
"dataType": {
309+
"type": "fixed_length_string",
310+
"precision": 255,
311+
"scale": 0
312+
}
313+
},
314+
{
315+
"id": "D7A48B699698415E9D9E816B7C8C9ABC",
316+
"name": "ffsqlAgeV1",
317+
"dataType": {
318+
"type": "integer",
319+
"precision": 4,
320+
"scale": 0
321+
}
322+
},
323+
{
324+
"id": "6E3B8DBA172E4943BA1614ABB2AC5AC4",
325+
"name": "ffsqlScoreV1",
326+
"dataType": {
327+
"type": "integer",
328+
"precision": 4,
329+
"scale": 0
330+
}
331+
}
332+
],
333+
"sqlExpression": {
334+
"tree": {
335+
"function": "concat_no_blank",
336+
"children": [
337+
{
338+
"type": "constant",
339+
"variant": {
340+
"type": "string",
341+
"value": "SELECT id, name, age, score FROM hackathon.mytest;"
342+
}
343+
}
344+
],
345+
"type": "operator"
346+
}
347+
}
348+
},
349+
"attributes": [
350+
{
351+
"id": "FF816775FB784C75B3BA2B63BAECDE96",
352+
"name": "ffsqlIdV1",
353+
"forms": [
354+
{
355+
"id": "45C11FA478E745FEA08D781CEA190FE5",
356+
"name": "ID",
357+
"category": "ID",
358+
"type": "system",
359+
"displayFormat": "number",
360+
"expression": {
361+
"tree": {
362+
"type": "column_reference",
363+
"objectId": "186F0F9D63C94E12A129296F94970A7E",
364+
"name": "ffsqlIdV1"
365+
}
366+
}
367+
}
368+
]
369+
},
370+
{
371+
"id": "FB045BB2C57D45488879EC303B76C129",
372+
"name": "ffsqlNameV1",
373+
"forms": [
374+
{
375+
"id": "45C11FA478E745FEA08D781CEA190FE5",
376+
"name": "ID",
377+
"category": "ID",
378+
"type": "system",
379+
"displayFormat": "text",
380+
"expression": {
381+
"tree": {
382+
"type": "column_reference",
383+
"objectId": "E8F67F57C68B463390209166D5679F79",
384+
"name": "ffsqlNameV1"
385+
}
386+
}
387+
}
388+
]
389+
}
390+
],
391+
"metrics": [
392+
{
393+
"id": "FA1A75DDC3BF4864932E8C20BF17801D",
394+
"name": "ffsqlAgeV1",
395+
"dataType": {
396+
"type": "numeric",
397+
"precision": 0,
398+
"scale": 0
399+
},
400+
"expression": {
401+
"tree": {
402+
"type": "column_reference",
403+
"objectId": "D7A48B699698415E9D9E816B7C8C9ABC",
404+
"name": "ffsqlAgeV1"
405+
}
406+
}
407+
},
408+
{
409+
"id": "398954E92D7D4395894DAC4B18E7B453",
410+
"name": "ffsqlScoreV1",
411+
"dataType": {
412+
"type": "numeric",
413+
"precision": 0,
414+
"scale": 0
415+
},
416+
"expression": {
417+
"tree": {
418+
"type": "column_reference",
419+
"objectId": "6E3B8DBA172E4943BA1614ABB2AC5AC4",
420+
"name": "ffsqlScoreV1"
421+
}
422+
}
423+
}
424+
],
425+
"dataSource": {
426+
"objectId": "A528E3A1436D9C08318735BC915FCF13",
427+
"subType": "db_role_import",
428+
"name": "tutorial_wh"
429+
}
430+
}
431+
}
432+
```
433+
434+
Response Code: 200 (The cube’s definition was returned successfully.)
435+
185436
## Retrieve a cube’s definition with filter in tokens format
186437

187438
<Available since="2021 Update 5" />

0 commit comments

Comments
 (0)