Defining DeepSee Models
Defining Listings
[Home] [Back] [Next]
InterSystems: The power behind what matters   
Class Reference   

This chapter describes how to define listings. It discusses the following topics:

In Studio, you can define formatting for a listing. See <listing>,” in the appendix Reference Information for Cube Classes.”
You can also define individual listing fields with which users can create custom listings in the Analyzer. See the next chapter.
You can also define listings outside of cube definitions (and without needing access to the Architect). See the chapter Defining Listing Groups.”
Adding a Listing
To add a listing:
  1. Click Add Element.
    The system displays a dialog box.
  2. For Enter New Item Name, type a listing name.
    See Names for Model Elements,” earlier in this book.
  3. Click Listing.
  4. Click OK.
  5. Select the listing name in the Model Viewer, in the Listings section.
  6. Optionally specify the following details:
  7. Define the listing as described in the following sections.
Defining a Simple Listing
A simple listing uses fields in the source table that is used by the cube. To define a simple listing, add a listing as described earlier in this chapter and specify the following options:
Additional Options
Note the following points:
By default, Caché uses the logical values for the fields. To instead use the display values, use the Caché SQL function %EXTERNAL.
Defining a Data Connector Listing
A data connector listing uses fields in a data connector. To define such a listing, add a listing as described earlier in this chapter and specify the following options:
Defining an SQL Custom Listing
An SQL custom listing can use fields from tables other than the source table used by the cube. (Note that it cannot use fields from a data connector.)
DeepSee supports another kind of “custom” listing — a listing defined by users in the Analyzer. See <listingField> in the appendix Reference Information for Cube Classes.”
To define an SQL custom listing, add a listing as described earlier in this chapter and specify the following options:
Before looking at the details of the Custom SQL query, it is necessary to understand how DeepSee creates listings. For any listing, the system creates a temporary listing table that contains the set of source ID values that correspond to the facts used in the current context (the context in which the user requests the listing). Your custom SQL query selects fields where the records match the source IDs in the temporary listing table. Internally, the overall query might be as follows:
SELECT source.Field1,source.Field2 
FROM DeepSee_Study.Patient source,internal-listing-table-name list 
WHERE source.%ID=list.sourceID AND list.queryKey='2144874459'
When you specify an SQL custom query, you specify tokens to replace some of these details. Specifically, for Custom SQL, you provide a query with the following basic form:
SELECT list of field names  FROM $$$SOURCE, othertable AS alias  WHERE $$$RESTRICT AND otherrestriction
As a simple example (which uses only the source table of the cube):
SELECT source.PatientID,source.Age,source.HomeCity->Name 
For another example (using data from other tables):
SELECT source.PatientID,FavoriteColor 
FROM $$$SOURCE, DeepSee_Study.PatientDetails AS details 
WHERE $$$RESTRICT AND source.PatientID=details.PatientID
Defining a Map Listing (Geo Listing)
By default, Listing type is table, and the listing displays a table of information. If you have suitable data, you can instead specify Listing type as map. In this case, the listing is a map with markers to indicate geographic locations contained in the listing data. For example, the map could highlight sales locations or customer locations. For example:
A map listing uses the Google Maps API. Be sure that your usage of this API is consistent with the Terms of Use, which you can access via a link displayed in this listing, as shown in the previous picture.
Note that in order to use the Google Maps API, you must obtain an API key. See Specifying Basic Settings in the DeepSee Implementation Guide for more information.
To define such a listing, use the general instructions earlier in this chapter and do the following:
The listing query can also contain other fields. Any additional fields are displayed in a balloon when the user clicks a map position. For example:
This example is from the Aviation demo; see Using Unstructured Data in Cubes (iKnow) in the Advanced DeepSee Modeling Guide.