InterSystems MDX Reference
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 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.
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
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
Content Date/Time: 2019-04-10 14:45:56