Skip to main content

%DeepSee.KPIPlugIn

Class %DeepSee.KPIPlugIn Extends %DeepSee.KPI [ Abstract, System = 4 ]

Subclasses of this class are used to implement analytic "plug-ins" for DeepSee.

Parameters

CACHEABLE

Parameter CACHEABLE = 1;

ASYNC

Parameter ASYNC = 1;

PUBLIC

Parameter PUBLIC = 0;

By default, plug-ins are not visible to dashboards.

BASECUBE

Parameter BASECUBE As STRING;

Cube that this plug-in is based on. This determines which cubes (or subject areas based on this cube) can see this plug-in. This can be a comma-delimited list. The cube name(s) should not be enclosed with [].

PLUGINTYPE

Parameter PLUGINTYPE As STRING [ Constraint = ",Pivot,Aggregate", Flags = ENUM ] = "Pivot";

Specifies the type of this plug-in. This indicates the context in which this plug-in is used.
"Pivot" -- the plug-in is visible within the Analyzer dimension tree.
"Aggregate" -- the plug-in is not visible within the Analyzer dimension tree.

LISTINGSOURCE

Parameter LISTINGSOURCE As STRING [ Constraint = ",SourceTable,FactTable", Flags = ENUM ] = "SourceTable";

Specifies the source of the listing data used by this plugin: "SourceTable" - the data source supplies the listing values; "FactTable" - the fact table supplies the listing values.

LISTINGFIELDS

Parameter LISTINGFIELDS As STRING;

If defined, this the field list (RETURN clause) of the listing used to supply data for this plug-in.

Properties

%sqlResultSet

Property %sqlResultSet As %SQL.StatementResult;

Iterator for SQL results that will drive the computation of this plugin.

%factCount

Property %factCount As %Integer;

Number of facts in the "listing" that is driving this KPI.

%plugInListingKey

Property %plugInListingKey As %String;

Methods

%GetPlugInType

ClassMethod %GetPlugInType() As %String

Return the type of this plug in.

%GetBaseCube

ClassMethod %GetBaseCube() As %String

Return the cube(s) this KPI is based on.

%OnGetMDX

Method %OnGetMDX(ByRef pMDX As %String) As %Status

This callback defines the default MDX query used for analysis. It also checks for the current values in the filters.
By default, select all facts from the first base cube.
This may be overridden by subclasses.

%OnGetAnalysisResultSet

Method %OnGetAnalysisResultSet(Output pRS As %SQL.StatementResult, pSQL As %String) As %Status

Return an %SQL.StatementResult object that will iterate over the facts used for analysis.

%OnGetListingSource

Method %OnGetListingSource() As %String

Returns the source of the listing data used by this plugin: "SourceTable" - the data source supplies the listing values; "FactTable" - the fact table supplies the listing values.

%OnGetListingFields

Method %OnGetListingFields() As %String

Returns the field list (RETURN clause) of the listing used to supply data for this plug-in.

%OnGetListingOrderBy

Method %OnGetListingOrderBy() As %String

Returns the MDX %ORDER BY clause for the drillthrough query used to supply data for this plug-in.

%OnGetListingMaxRows

Method %OnGetListingMaxRows() As %String

Returns the MDX MAXROWS clause for the drillthrough query used to supply data for this plug-in.

%GetAnalysisResultSet

Method %GetAnalysisResultSet(Output pRS As %SQL.StatementResult, Output pCubeName As %String, Output pQueryKey As %String) As %Status [ Final, Internal ]

Return an %SQL.StatementResult object that will iterate over the facts used for analysis.
pCubeName is the cube name for the underlying MDX query.
pQueryKey is the query key for the underlying MDX query.

%OnComputeKPITimestamp

Method %OnComputeKPITimestamp(ByRef pTimestamp As %String, pSourceType As %String, pQueryText As %String = "") As %Status

Compute and return the KPI cache timestamp for the current KPI result.

%OnComputeKPICacheKey

Method %OnComputeKPICacheKey(Output pCacheKey As %String, pQueryText As %String = "") As %Status [ Internal ]

Compute the kpi cache key for the current KPI result. Also creates the context for executing this KPI.

%OnCompute

Method %OnCompute(pSQLRS As %SQL.StatementResult, Output pFactCount As %Integer) As %Status

Compute value(s) for this plug-in.
pSQLRS is an SQL result set (%SQL.StatementResult) that will iterate over a set of facts and provide the base data for the calculations.
pFactCount Is the number of facts in the set.
Plug-in classes should implement this method to perform their calculations.

%OnLoadKPI

Method %OnLoadKPI() As %Status [ Final ]

Notification that this KPI is being executed.
In this case, we compute the value of this plug-in by setting up the context and invoking the %OnCompute method.
Plug-in classes should implement the %OnCompute method.

%OnGetFilterMembers

ClassMethod %OnGetFilterMembers(pFilter As %String, Output pMembers As %List, pSearchKey As %String = "", pDataSourceName As %String = "", ByRef pFilterValues As %String) As %Status

Callback to get additional members for a KPI filter. This takes the form:
pMembers($I(pMembers))=$LB(text,value)
In this case, return members for certain "built-in" filters such as "%cube" and "%measure".

%GetPluginMDX

Method %GetPluginMDX(Output pStatus As %Status) As %String

Plugins have a context-specific DRILLTHROUGH/DRILLFACTS MDX query that is executed to ultimately produce the SQL resultset containing the target records for analysis. This method decorates the base query with the MDX resultset cell context and directs the drill to the proper source.

%GetSourceType

ClassMethod %GetSourceType() As %String

Return the sourceType for this KPI. Always "custom" for plugins.

%OnKPICleanup

Method %OnKPICleanup() As %Status [ Internal ]