InterSystems IRIS Data Platform 2019.2  /  InterSystems MDX Reference  /  MDX Statements and Clauses

InterSystems MDX Reference
Previous section           Next section
InterSystems: The power behind what matters   

Displays the lowest-level data associated with the first cell of results of a given SELECT statement, using the fact and dimension tables defined by the cube.
Syntax and Details
DRILLFACTS select_statement
DRILLFACTS select_statement RETURN fieldname1, fieldname2, ...
DRILLFACTS select_statement RETURN fieldname1, ... %ORDER BY fieldname3, ...
If you do not specify the RETURN clause, the query returns the IDs of the records.
The %ORDER BY clause is an InterSystems extension to MDX. This clause specifies how to sort the displayed records.
For additional details on RETURN and %ORDER BY, see DRILLTHROUGH Statement.
Internally, the system builds and uses an SQL query.
If the SELECT statement returns more than one cell of data, the listing shows only the fields associated with the first cell.
The first example does not use RETURN, so it uses the default listing as defined in the cube:
DRILLFACTS SELECT diagd.osteoporosis ON 0 FROM patients
   #  ID
   1: 7
   2: 13
   3: 42
   4: 123
   5: 140
The next example uses the RETURN clause:
drillfacts select diagd.osteoporosis on 0 from patients return dxcolor->dxcolor, dxage, dxpatgroup->dxpatgroup
   #  DxColor        DxAge          DxPatGroup
   1: Orange         7              Group A
   2: Red            11             Group B
   3: <null>         30             Group A
   4: Purple         58             Group A
   5: Purple         62             None
See Also

Previous section           Next section
Send us comments on this page
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-09-18 06:45:48