%DeepSee.ComputedDimension.Base
Class %DeepSee.ComputedDimension.Base Extends %RegisteredObject [ System = 3 ]
This is the base class for DeepSee computed dimension classes.
A computed dimension class defines the behavior for a level within a hierarchy within a DeepSee computed dimension.
Parameters
DIMTYPE
Parameter DIMTYPE As STRING = "text";
Type reported back to the UI. This determines what type of control to display for filters based on this class.
CACHECOMPUTEDBITSET
Parameter CACHECOMPUTEDBITSET As STRING [ Constraint = ",NEVER,CHECK", Flags = ENUM ] = "NEVER";
Controls whether results of %OnComputeBitset can be reused Available values are "NEVER", "CHECK", with NEVER (default) meaning no values are cached and CHECK meaning the timestamp of previous %OnComputeBitset results is compared to the cube's latest update timestamp.
BEHAVIOR
Parameter BEHAVIOR As STRING [ Constraint = ",BITSET,MDX", Flags = ENUM ] = "BITSET";
Controls the run-time behavior of the dimension. Available values are "BITSET", and "MDX".
BITSET (default) indicates that this class will compute a set of bits that define membership within a given dimension member.
MDX indicates that this class will return a set of valid MDX expressions that will be used to resolve the members of the dimension.
Properties
%cube
Property %cube As %DeepSee.Datatype.string;
Name of the cube the computed level belongs to.
%baseCube
Property %baseCube As %DeepSee.Datatype.string;
Name of the base cube the computed level belongs to, if ..%cube is a subject area. Otherwise, this property is set to the same value as ..%cube.
%factNumber
Property %factNumber As %Integer;
Fact # of the computed level.
%factName
Property %factName As %String;
Fact Name associated with the computed level. This is the name of the fact that contains the default search data.
%dimNumber
Property %dimNumber As %Integer;
Dimension # of the computed level.
%hierNumber
Property %hierNumber As %Integer;
Hierarchy # of the computed level.
%levelNumber
Property %levelNumber As %Integer;
Level # of the computed level.
Methods
%GetDimType
ClassMethod %GetDimType() As %String
Return the type of this class (used by UI components).
%GetBehavior
ClassMethod %GetBehavior() As %String
Return the behavior of this class.
%Count
ClassMethod %Count(pCube As %String, pDimNo As %Integer, pHierNo As %Integer, pLevelNo As %Integer) As %Integer
Return number of members.
%GetLevelNumber
ClassMethod %GetLevelNumber(pCube As %String, pDimNo As %Integer, pHierNo As %Integer, pLevelName As %String) As %Integer
Given a level name, pLevelName, return the corresponding level number. Return "" if there is no level with the name.
%Create
ClassMethod %Create(pCube As %String, pFactNo As %Integer, pDimNo As %Integer, pHierNo As %Integer, pLevelNo As %Integer) As %DeepSee.ComputedDimension.Base
Create a instance of this dimension class.
%FindComputedMemberByName
Method %FindComputedMemberByName(pName As %String, Output pFlag As %Boolean, Output pMemberKey As %String, Output pMemberId As %String) As %Status [ Internal ]
Test if pName is a valid member name.
%FindComputedMemberByKey
Method %FindComputedMemberByKey(pKey As %String, Output pFlag As %Boolean, Output pMemberName As %String, Output pMemberId As %String) As %Status [ Internal ]
Find the member with the given key value.
%GetAllMembers
Method %GetAllMembers(ByRef pMemberList, pCube As %String, pDimNo As %Integer, pHierNo As %Integer, pLevelNo As %Integer) As %Status
Return the set of all members (pre-defined and run-time) for this dimension. Sort them according to the sort options in the cube meta data.
pMemberList returns a set of members defined in the cube model:
pMemberList(n) = $LB(id,caption,key,[format])
%GetPredefinedMembers
ClassMethod %GetPredefinedMembers(ByRef pMemberList, pCube As %String, pDimNo As %Integer, pHierNo As %Integer, pLevelNo As %Integer) As %Status
Return the set of pre-defined members for this dimension. These will be in the cube meta data.
pMemberList returns a set of members defined in the cube model: pMemberList(n) = $LB(id,caption,key,[format])
%GetComputedMembers
Method %GetComputedMembers(ByRef pMemberList, pRollupKey As %String = "", ByRef pRange As %String = "") As %Status [ Final ]
Find the set of members for this computed dimension object.
pMemberList may contain a set of members defined in the cube model: pMemberList(n) = $LB(id,name,key,[format])
If so, use this list, otherwise compute one.
pRollupKey and pRange can be used to filter the computed members returned, if applicable for this computed dimension.
%OnGetComputedMembers
Method %OnGetComputedMembers(ByRef pMemberList) As %Status [ Deprecated ]
Find the set of members for this computed dimension object.
pMemberList(n) = $LB(id,name,key)
This can be implemented by subclasses.
This method is deprecated, implement %OnGetComputedMembersFiltered instead.
%OnGetComputedMembersFiltered
Method %OnGetComputedMembersFiltered(ByRef pMemberList, pRollupKey As %String = "", ByRef pRange As %String = "") As %Status
Find the set of members for this computed dimension object satisfying pRollupKey and pRange (if applicable for this implementation).
pMemberList(n) = $LB(id,name,key)
This can be implemented by subclasses.
%ComputeIndexKey
Method %ComputeIndexKey(pMemberKey As %String) As %String
Compute a hash key for a given member member.
%ComputeBitset
Method %ComputeBitset(pSpec As %String, Output pIndexKey As %String) As %Status [ CodeMode = objectgenerator, Final, ForceGenerate ]
Build the bitset that corresponds to the given computed dimension "spec".
%OnComputeBitset
Method %OnComputeBitset(pSpec As %String, pIndexKey As %String) As %Status
Do the actual work of building the bitset. Implemented in subclasses.
%CreateIndexFromSQL
Method %CreateIndexFromSQL(pSQL As %String, pIndexKey As %String, pRS As %SQL.StatementResult = "", pTranslateIds As %Boolean = 0) As %Status
Utility method. Prepare and execute the given SQL statement and build an index from it.
If optional pRS is supplied, use it to fetch ID values (result set must have an ID column).
If pTranslateIds is true, then translate source id value to fact ids.
%CreateIndexFromSearchableMeasure
Method %CreateIndexFromSearchableMeasure(pSearchMeasureIndex As %String = "", pComparison As %String, pValue As %Numeric, pIndexKey As %String = "") As %Status
Utility method. Build an index directly from a comparison on a searchable measure. The comparison is supplied by the arguments
pSearchMeasureIndex - The name of the searchable index on the searchable measure
pComparison - The comparison operator; legal values are SQL numeric comparisons: <,<=,=,=>,>,<>
pValue - The target value of the comparison. This must be numeric
pIndexKey - The key of the new index being constructed out of the searchable measure
%GetFactTable
Method %GetFactTable() As %String
Return the (SQL) name of the fact table for the current cube.
%GetSourceTable
Method %GetSourceTable() As %String
Return the (SQL) name of the source table for the current cube.
%MemberSearch
Method %MemberSearch(pSearchKey As %String, Output pList As %List) As %Status
Execute a search for members.
Return a list of the form:
pList(n) = $LB(value,key)
%ResolveKey
Method %ResolveKey(pSpec As %String, Output pRKey As %String) As %Status
Resolve any special tokens or expression in a key value and return the result.
%ProcessSQL
Method %ProcessSQL(pSQL As %String, ByRef pSubstList, Output pFirstToken As %String, Output pErrorMsg As %String) As %String
Apply substitutions to an SQL query string used within a computed dimension expression.
pSubstList is an array of $$$ substitution values, e.g.:
pSubstList("TABLE") = table name
pSubstList("FACT") = fact name
{} can be used to enclose an ObjectScript expression that is evaluated and whose results become part of the SQL text of the query.
[dim].[mbr] can be used to refer to a specific cube element (such as a measure). This is replaced with the fact name that corresponds to the element.
%Eval
ClassMethod %Eval(pExpr As %String, Output pErrorMsg As %String) As %String
Evaluate the given ObjectScript expression.
%GetCurrentQuery
Method %GetCurrentQuery() As %DeepSee.Query.query [ Private ]
Returns the %DeepSee.Query.query object for the current query context, if any
%OnKillFacts
ClassMethod %OnKillFacts(pCubeName As %String, pFactNo As %Integer, pDimNo As %Integer, pHierNo As %Integer, pLevelNo As %Integer) As %Status [ CodeMode = objectgenerator, ForceGenerate ]
Notifies the computed dimension all facts of a cube referencing are being killed. This method should erase any temporary or cached data the computed dimension implementation has written as part of its "lifetime" for the given cube and dimension coordinates. Indices cached as part of the CACHECOMPUTEDBITSET setting are taken care of by the default implementation of this method.
%GetMemberSpec
ClassMethod %GetMemberSpec(pMemberId As %String, pCubeName As %String, pDimNo As %Integer, pHierNo As %Integer, pLevelNo As %Integer) As %String [ Internal ]
Return the member specification for the given member.
Implement this so that %GetFiltersForCellRange will work!
%MemberSearchByMembers
Method %MemberSearchByMembers(pSearchKey As %String, Output pList As %List) As %Status
Helper method; execute a member search using the set of defined (and run-time) members.
%MemberSearchByIndex
Method %MemberSearchByIndex(pSearchKey As %String, Output pList As %List) As %Status
Helper method; execute a member search using the contents of the fact index.