Getting Started with DeepSee
Introduction to the Other DeepSee Tools
[Home] [Back] [Next]
InterSystems: The power behind what matters   

This chapter introduces the other tools for working with DeepSee.

MDX Shell
DeepSee provides a shell in which you can issue MDX queries to explore your DeepSee cubes and subject areas. This section introduces this shell and lists the supported MDX options and functions.
For an introduction to MDX queries, see Using MDX with DeepSee, which contains many examples.
Also see the DeepSee MDX Reference.
Accessing the MDX Shell
To access the MDX shell, start the Terminal and do the following:
  1. Switch to the namespace in which you defined the cube or subject area.
  2. Enter the following command:
     Do ##class(%DeepSee.Utils).%Shell()
Now you can enter MDX queries like the following:
SELECT MEASURES.[%COUNT] ON 0, birthd.decade.MEMBERS ON 1 FROM patients
When you do so, the shell executes the query, displays its results to the console, and redisplays the shell prompt, as follows:
                             Patient Count
 1 1910s                                 71
 2 1920s                                223
 3 1930s                                572
 4 1940s                                683
 5 1950s                              1,030
 6 1960s                              1,500
 7 1970s                              1,520
 8 1980s                              1,400
 9 1990s                              1,413
10 2000s                              1,433
11 2010s                                155
Elapsed time:       .014128s
In the shell:
Viewing the Indices Used by a Query
The DeepSee shell provides a quick way to see the indices that a query uses:
  1. Issue the following shell command:
    stats on
  2. Enter the query, preceded by %SHOWPLAN. For example:
    %SHOWPLAN SELECT aged.[age group].members ON 0, allerd.H1.MEMBERS ON 1 FROM patients WHERE
                               0 to 29           30 to 59               60 +
     1 additive/colorin              27                 19                 14
     2 animal dander                 15                 25                  8
     3 ant bites                     15                 19                 11
     4 bee stings                    24                 27                  7
     5 dairy products                25                 25                  4
     6 dust mites                    28                 23                 10
     7 eggs                          19                 21                 13
     8 fish                          26                 17                 11
     9 mold                          23                 23                  6
    10 nil known allerg              80                 82                 21
    11 No Data Availabl             216                194                 92
    12 peanuts                       26                 15                  8
    13 pollen                        29                 22                 11
    14 shellfish                     29                 23                 14
    15 soy                           25                 25                  6
    16 tree nuts                     22                 18                  8
    17 wheat                         16                 17                  8
    -------------- Query Plan ---------------------
    **DIMENSION QUERY (%FindMemberByName): SELECT TOP 1 %ID,Dx327553094 MKEY,Dx327553094 FROM 
    Cubes_StudyPatients.Star327553094 WHERE Dx327553094=? ORDER BY Dx327553094**
    **EXECUTE PARALLEL: 1x1 task(s) **
    -------------- End of Plan -----------------
    Line breaks were added here for readability.
DeepSee captures all the indices used by the query and reports them. Note that the query results are not necessarily correct because the query is only partially run; the purpose of %SHOWPLAN is to enable you to see the indices, not to get the query results.
Utility Methods
Data Connector
The data connector class (%DeepSee.DataConnector) enables you to make arbitrary SQL queries available for use in DeepSee cubes and listings. See the DeepSee Implementation Guide.
Result Set API
The class %DeepSee.ResultSet enables you to execute MDX queries programmatically and access the results.
For information, see the DeepSee Implementation Guide.
JavaScript and REST APIs
The DeepSee JavaScript API is provided by the file DeepSee.js, which is in the install-dir/CSP/broker directory. This JavaScript library enables you to interact with DeepSee from a client that is based on JavaScript. The functions in this library are a wrapper for a REST-based API for DeepSee. You can also use the REST API directly.
For information, see Tools for Creating DeepSee Web Clients.

Send us comments on this page
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA