Skip to main content

%DeepSee.Utils

Class %DeepSee.Utils Extends %RegisteredObject [ System = 4 ]

This class contains a number of DeepSee utility methods.

Parameters

DOMAIN

Parameter DOMAIN = "%DeepSee";

Methods

%Reset

ClassMethod %Reset(pClearCells As %Boolean = 0) As %Status

Stops all DeepSee background agents, clears any pending tasks, and clears the result cache for the current namespace. If pClearCells is true, then the cell cache for the current namespace is also cleared.
This method is provided as a convenience for developers for use on development or test systems. You should not use this method on production systems as it will have immediate effect on the performance of end user operations.

%TestForCancel

ClassMethod %TestForCancel(pFlag As %String = "") As %Boolean [ Internal ]

Test if the current query execution should be cancelled. Not currently used.

%RunServerInitCode

ClassMethod %RunServerInitCode() As %Status

Run the server init code.
This gives customer applications a chance to establish environmental settings. This is called whenever a DeepSee session is created or when a background process begins work on a %DeepSee.WorkMgr queue.
The server init code is a valid ObjectScript expression stored in the ^DeepSee.InitCode global. Server init code should not write any output to the current device nor should this code kill any % variables required by Zen or DeepSee.

%RunServerCloseCode

ClassMethod %RunServerCloseCode() As %Status

Run the server close code.
This gives customer applications a chance to clear environmental settings. This method is called whenever a DeepSee session is closed or when a background process completes work on a %DeepSee.WorkMgr queue.
The server close code is a valid ObjectScript expression stored in the ^DeepSee.CloseCode global. Server close code should not write any output to the current device nor should this code kill any % variables required by Zen or DeepSee.

%RunServerAuditCode

ClassMethod %RunServerAuditCode(pDashboardId As %String) As %Status

Run the server audit code.
This gives customer applications a chance to audit viewing of DeepSee dashboard pages. This is called whenever a DeepSee dashaboard is viewed in the user portal.
The server audit code is a valid ObjectScript expression stored in the ^DeepSee.AuditCode global. Server audit code should not write any output to the current device nor should this code kill any % variables required by Zen or DeepSee.
The variable, %dsDashboard, will contain the id (name) of the current dashboard item.

%IsCubeAvailable

ClassMethod %IsCubeAvailable(pCubeName As %String, Output pReason As %String) As %Boolean

Test if the given cube is available for querying.

%BuildCube

ClassMethod %BuildCube(pCubeName As %String = "", pAsync As %Boolean = 1, pVerbose As %Boolean = 1, pIndexOnly As %Boolean = 0, pMaxFacts As %Integer = 0, pTracking As %Boolean = 1, ByRef pBuildStatistics As %String = "", pFactList As %String = "") As %Status

Update all facts in the DeepSee cube pCubeName with data from the source table.
This will delete any information currently in the cube.

pAsync controls whether DeepSee performs the build in multiple background processes. If this argument is true, the system uses multiple processes and does not return until they are all complete. If this argument is false, the system uses a single process and does not return until it is complete.
If you have specified initialBuildOrder, the system will reset the value of pAsync to 0 and use a single process to build the cube. The presence of initialBuildOrder in the cube definition will override this setting and will force pAsync=0. The parameter may be passed by reference to communicate to the caller whether or not this override has taken place.
When a limit is imposed on background agents for a particular namespace using %SetAgentCount, only one build may be active at a time in that namespace. This will not have any effect on behavior of builds in other namespaces.
If pVerbose is true, then status information is written to the console.
If pIndexOnly is true, only rebuild the fact table indices.
If pMaxFacts is non-zero, then only build this number of facts.
pTracking is an internal argument used when this method is run in the background and specifies that status information should be stored.
pBuildStatistics returns an array of information about the cube build.
The array has four subscripts. For example, if tStats is the argument used, as in:
do ##class(%DeepSee.Utils).%BuildCube("PATIENTS",1,,,,,.tStats) the array will look like the following:
tStats("elapsedTime")=10.000643
tStats("errors")=1
tStats("factCount")=5000
tStats("missingReferences")=1

If the pFactList is supplied the build will only update the columns listed in that fact list. The list must consist of the specific fact names and can have either a comma-delimited or $LB format. If this list is supplied, the specific facts being updated will be individually marked as unavailable for queries and queries referencing dimensions based on those facts will throw an error on prepare.

%LogBuildError

ClassMethod %LogBuildError(pCubeName As %String = "", pRecordID As %Integer = 0, pStatus As %Status = {$$$OK}) As %Status

Log a %Status to the ^DeepSee.BuildErrors global.

%BuildStatus

ClassMethod %BuildStatus(pCubeName As %String = "")

Command line utility for monitoring cube build progress. This repeats the same information available to the Architect's build winow in a terminal.

%FixBuildErrors

ClassMethod %FixBuildErrors(pCube As %String, pVerbose As %Boolean = 1) As %Status

For the given cube, iterate over all facts in the build error log and attempt to reprocess each fact. If the processing succeeds, remove the item from the error log.

%PrintBuildErrors

ClassMethod %PrintBuildErrors(pCube As %String = "", pMaxErrors = 0)

Display the list of errors encountered in the most recent build of the given cube.

%PrecomputeAggregates

ClassMethod %PrecomputeAggregates(pCubeName As %String, pAsync As %Boolean = 1, pVerbose As %Boolean = 1, pTracking As %Boolean = 0) As %Status

Precompute aggregate values for the given cube (if its precompute property is non-zero).
If pAsync is true, then background tasks are used.
If pVerbose is true, then status information is written to the console.

%ComputeAggregateGroup

ClassMethod %ComputeAggregateGroup(pCubeName As %String, pGroupName As %String, pVerbose As %Boolean = 1) As %Status

Precompute the aggregates witin the given cube and the given group name within the cube's CellCache specification.
Set pGroupName to "*" for all groups.

%ComputeAggregateCombos

ClassMethod %ComputeAggregateCombos(pCubeName As %String, ByRef pCombos, pVerbose As %Boolean = 1, pTracking As %Boolean = 0) As %Status

Loop over fact table for cube and precompute the aggregates for the specified combinations in pCombo.
pCombo(n) = "FactName1,FactName2,MsrName1"

%ComputeAggregateForBucket

ClassMethod %ComputeAggregateForBucket(pCubeName As %String, pStartChunk As %Integer, pEndChunk As %Integer, ByRef pFactList, ByRef pWorkList, pVerbose As %Boolean = 1, ByRef pCount As %Integer) As %Status [ Internal ]

Compute aggregate combinations for one "bucket".

%DeleteObsoleteCache

ClassMethod %DeleteObsoleteCache(pCubeName = "") As %Status [ Internal ]

Delete any stale cache for cube pCubeName.

%PurgeObsoleteCache

ClassMethod %PurgeObsoleteCache(pCubeName As %String) As %Status [ Internal ]

[Deprecated] Cache is purged automatically on cube update and does not need to be called in user code.

%ProcessFact

ClassMethod %ProcessFact(pCubeName As %String, pSourceId As %String = "", pVerbose As %Boolean = 0, Output pMissingReferences As %Integer, pFactList As %String = "") As %Status

For the specified cube, update one fact from the source table (with id of pSourceId). If the fact does not yet exist, it is inserted, if does exist it is updated.
If pVerbose is true, then status information is written to the console.
pMissingReferences how missing references to related cubes were encountered. Refer to the %SynchronizeCube for details.
This method logs current time as the cube's last data update but does not advance the cube's DSTIME timestamp.

%DeleteFact

ClassMethod %DeleteFact(pCubeName As %String, pSourceId As %String = "", pVerbose As %Boolean = 0) As %Status

For the specified cube, delete one fact from the source table (with id of pSourceId). If pVerbose is true, then status information is written to the console.
This method logs current time as the cube's last data update but does not advance the cube's DSTIME timestamp.

%SynchronizeCube

ClassMethod %SynchronizeCube(pCubeName As %String = "", pVerbose As %Boolean = 1, Output pFactsUpdated As %Integer, pReadCommitted As %Boolean = 1, pCheckReferences As %Boolean = 1, pAsync As %Boolean = 0, ByRef pSynchronizeStatistics As %String = "") As %Status

For the specified cube, find and apply all changes from the source data that have been made since the last call to this method. If pVerbose is true, then status information is written to the console.

On return, pFactsUpdated will return the number of facts updated.

By default, reads from the source table use READ COMMITTED mode, you can turn this off (if you can tolerate reads of values from uncommitted transactions) by setting pReadCommitted to 0.

If this cube has facts that reference (via relationships) facts within another cube and any of those remote facts are missing (because the related cube has not been synchronized), then this method will report success and the missing references will be treated as build errors.
To avoid this type of error, it is better to plan your synchronization so that the related cubes are synchronized first (in the same order the cubes are built).

The pCheckReferences argument is deprecated and no longer has any effect on updates.

pAsync controls whether DeepSee performs the synchronize in multiple background processes. If this argument is true, the system uses multiple processes and does not return until they are all complete. If this argument is false, the system uses a single process and does not return until it is complete.
By default this method runs in the synchronous mode to avoid any potential interference with agents involved in background processing. If asynchronous mode is turned on, the synchronization work will be divided among all available Low priority agents.

pSynchronizeStatistics returns an array of information about the synchronize.
The array has four subscripts. For example, if tStats is the argument used, as in:
do ##class(%DeepSee.Utils).%SynchronizeCube("PATIENTS",1,,,,,.tStats) the array might look like the following:
tStats("elapsedTime")=.000643
tStats("errors")=1
tStats("factCount")=5
tStats("missingReferences")=1

If any errors occur during the synchronize process but all source records are successfully checked, this cube will treat processing for this timestamp as complete. The expectation is that any individual update errors can and should be resolved individually or through the %FixBuildErrors method and not by the synchronize itself.

%ProcessUpdateBuffer

ClassMethod %ProcessUpdateBuffer(pClassName = "", pNoKill = 0) As %Status [ Internal ]

Process the ^OBJ.DSTIME update buffer into the concurrency-protected update global. To protect an update entry in the ^OBJ.DSTIME buffer within a transaction, the process setting the buffer should use Lock +^DeepSee.Build(pClassName,ID) The ID is not needed for concurrency protection between the transactional process and %ProcessUpdateBuffer, but will prevent lock contention between transactional processes if this is used.

%ClearUpdateBuffer

ClassMethod %ClearUpdateBuffer(pClassName = "") As %Status [ Internal ]

Clear the update buffer for a given class. This will completely remove the current contents of ^OBJ.DSTIME(pClassName).

%HasUpdates

ClassMethod %HasUpdates(pClassName = "") As %Boolean

Test the ^OBJ.DSTIME update buffer for new updates in the class pClassName

%SetCubeDSTime

ClassMethod %SetCubeDSTime(pCubeName As %String, pVersion As %Integer = "") As %Status

Update the sync timestamp for the given cube.

%GetCubeDSTime

ClassMethod %GetCubeDSTime(pCubeName As %String, Output pStatus As %Status) As %Integer

Query the sync timestamp for the given cube.

%PurgeListings

ClassMethod %PurgeListings(pVerbose As %Integer = 0, pStartDay = "") As %Status

Purge all entries in the listing cache older than pStartDay. If this is omitted, the start day used will be the current day.

%PurgeDSTIME

ClassMethod %PurgeDSTIME(pVerbose As %Integer = 0, Output pPurged As %Library.String(MAXLEN="")) As %Status

%PurgeDSTIME purges all nodes in ^DeepSee.Update that have already been processed by all cubes, and by all classes that extend %DeepSee.TimeSync. This method checks the DSTIME value for each cube, and for each class that extends %DeepSee.TimeSync, and computes the oldest DSTIME value that has not yet been synchronized. All DSTIME values older than that time are purged from the DSTIME index.

If a class has entries in the DSTIME index and no cubes use that class as a source class then those DSTIME entries are not purged.

ParameterspVerboseInputIf true then status messages will be displayed on the current device.
pPurgedOutputAn array of DSTIME entries that have been purged. For example: purged("DeepSee.Study.CityRainfall")=1 purged("DeepSee.Study.Patient")=2 purged("HoleFoods.Transaction")=0 The array subscript is the class name and the value is the DSTIME value that was purged.

Return value: This method returns a %Status value indicating success or failure.

%PurgeUpdateBuffer

ClassMethod %PurgeUpdateBuffer(pClass As %String = "", pPurgeUpTo As %String = "", pIncrement As %Boolean = 1, pVerbose As %Boolean = 0) As %Status

Purge the ^OBJ.DSTIME update buffer when there are no cubes present to clear entries via updates.
pClass [Required] - The class to be purged from the ^OBJ.DSTIME update buffer. The "*" wildcard may be used to purge all classes present in the buffer.
pPurgeUpTo [Required] - This is the oldest timestamp that must be retained in the purge. Every entry older than this will be removed. The "*" wildcard may be used to remove all entries for the given pClass.
pIncrement - If true, the purge method will automatically advance the top node of ^OBJ.DSTIME to advance the timestamp of all non-interval type entries to support the next purge. This parameter is set to 1 by default.

%KillCube

ClassMethod %KillCube(pCubeName As %String = "", pForce = 0) As %Status

Delete all indices and cache values for the given cube.

%KillKPICacheForCube

ClassMethod %KillKPICacheForCube(pCubeName As %String) As %Status

Delete any KPI cache values for the given cube.

%GetCountName

ClassMethod %GetCountName(pCubeName As %String, Output pStatus As %Status) As %String

Given the logical name, pCubeName of a DeepSee cube, return the logical name of its %COUNT measure.

%GetCountCaption

ClassMethod %GetCountCaption(pCubeName As %String, Output pStatus As %Status) As %String

Given the logical name, pCubeName of a DeepSee cube, return the display name of its %COUNT measure.

%GetCubeFactClass

ClassMethod %GetCubeFactClass(pCubeName As %String, Output pStatus As %Status) As %String

Given the logical name, pCubeName of a DeepSee cube, return the class name of its fact table.

%GetCubeFactTable

ClassMethod %GetCubeFactTable(pCubeName As %String, Output pStatus As %Status) As %String

Given the logical name, pCubeName of a DeepSee cube, return the SQL name of its fact table.

%GetCubeFactCount

ClassMethod %GetCubeFactCount(pCubeName As %String, Output pStatus As %Status) As %Integer

Given the logical name, pCubeName of a DeepSee cube, return the number of rows within its fact table.

%GetCubeMemberCount

ClassMethod %GetCubeMemberCount(pCubeName As %String, Output pStatus As %Status, pDimName As %String = "", pHierName As %String = "", pLevelName As %String = "") As %Integer

Given the logical name, pCubeName of a DeepSee cube, return the number of members within the given dimension level.

%GetCubeName

ClassMethod %GetCubeName(pCubeName As %String, Output pStatus As %Status) As %String

Given the logical name, pCubeName of a DeepSee cube, return its name in its original case.

%IsCubeAbstract

ClassMethod %IsCubeAbstract(pCubeName As %String, Output pStatus As %Status) As %Boolean

Given the logical name, pCubeName of a DeepSee cube, test if it is abstract.
An abstract cube does not contain any data and cannot be queried.

%IsCubeCompound

ClassMethod %IsCubeCompound(pCubeName As %String, Output pJoinList As %String, Output pStatus As %Status) As %Boolean

Given the logical name, pCubeName of a DeepSee cube, test if it is a compound cube (composed of two or more cubes joined together).

%GetCubeModifiedDate

ClassMethod %GetCubeModifiedDate(pCubeName As %String, Output pStatus As %Status) As %DeepSee.Datatype.dateTime

Given the logical name, pCubeName of a DeepSee cube, return the date and time that the cube definition was last modifed.

%GetKPIModifiedDate

ClassMethod %GetKPIModifiedDate(pKPI As %String, Output pStatus As %Status) As %DeepSee.Datatype.dateTime

Given the logical name, pKPI of a DeepSee KPI, return the date of the time the KPI definition was modified (in $H format).

%GetCubeCaption

ClassMethod %GetCubeCaption(pCubeName As %String, Output pStatus As %Status) As %String

Given the logical name, pCubeName of a DeepSee cube, return its caption.

%GetKPICaption

ClassMethod %GetKPICaption(pKPI As %String, Output pStatus As %Status) As %String

Given the logical name, pKPI of a DeepSee KPI, return its caption.

%CubeExists

ClassMethod %CubeExists(pCubeName As %String = "", Output pStatus As %Status) As %Boolean

Given the logical name, pCubeName of a DeepSee cube, test if it exists.

%KPIExists

ClassMethod %KPIExists(pKPIName As %String = "", Output pStatus As %Status) As %Boolean

Given the logical name, pCubeName of a DeepSee cube, test if it exists.

%CheckPrivilege

ClassMethod %CheckPrivilege(pCubeName As %String) As %Boolean [ Final ]

Test that the current user holds privileges on the given cube.

%GetCubeClass

ClassMethod %GetCubeClass(pCubeName As %String, Output pStatus As %Status) As %String

Given the logical name, pCubeName of a DeepSee cube, return the class name of the cube definition.

%GetCubeActionClass

ClassMethod %GetCubeActionClass(pCubeName As %String, Output pStatus As %Status) As %String

Given the logical name, pCubeName of a DeepSee cube, return the class name of it associated actionClass, if any.

%GetCubeDescription

ClassMethod %GetCubeDescription(pCubeName As %String, Output pStatus As %Status) As %String

Given the logical name, pCubeName of a DeepSee cube return its class description.

%GetKPIName

ClassMethod %GetKPIName(pKPIName As %String, Output pStatus As %Status) As %String

Given the logical name, pKPIName of a DeepSee KPI, return its name in its original case.

%IsKPIPublic

ClassMethod %IsKPIPublic(pKPIName As %String) As %Boolean

Given the logical name, pKPIName of a DeepSee KPI, test if it is public.

%GetKPIDescription

ClassMethod %GetKPIDescription(pKPIName As %String, Output pStatus As %Status) As %String

Given the logical name, pKPIName of a DeepSee KPI return its class description.

%GetKPIClass

ClassMethod %GetKPIClass(pKPIName As %String, Output pStatus As %Status) As %String

Given the logical name, pKPIName of a DeepSee KPI, return the class name of the KPI definition.

%GetKPIList

ClassMethod %GetKPIList(Output pList) As %Status [ Final ]

Return a list of all currently defined DeepSee KPIs visible to the current user. This is used by utilities.
This list takes the form:
pList(NAME) = $LB(name,caption,moddate,type)

%GetKPIPlugInList

ClassMethod %GetKPIPlugInList(Output pList, pBaseName As %String = "", pPlugInType As %String = "", pUseCubeVersion As %Boolean = 0) As %Status [ Final ]

Return a list of all currently defined DeepSee "Plug-in" KPIs visible to the current user. If pBaseName is provided, then only list plug-ins visible to this base cube.
This is used by utilities.
This list takes the form:
pList(NAME) = $LB(name,caption,moddate,type)
pList(NAME,"props",propName) = ""

%GetWorksheetList

ClassMethod %GetWorksheetList(Output pList, pHidden As %Boolean = 0) As %Status [ Final ]

Return a list of all currently defined DeepSee worksheets visible to the current user. This is used by utilities.
This list takes the form:
pList(NAME) = $LB(name,caption,moddate,type)
If pHidden is true, then include trash and local items.

%GetMetricList

ClassMethod %GetMetricList(Output pList) As %Status [ Final ]

Return a list of all currently defined Business Metrics visible to the current user. This is used by utilities.
This list takes the form:
pList(NAME) = $LB(name,caption,moddate,type)

%GetDefaultMember

ClassMethod %GetDefaultMember(pCubeName As %String) As %String

Given the logical name, pCubeName of a DeepSee cube, return the default cube element (dimension and possibly level) as a string ("[Product].[Name]").
Note: this is no longer used by DeepSee.

%GetDefaultMeasure

ClassMethod %GetDefaultMeasure(pCubeName As %String) As %String

Given the logical name, pCubeName of a DeepSee cube, return the name of the default Measure. Note: this is no longer used by DeepSee.

%GetDefaultHierarchy

ClassMethod %GetDefaultHierarchy(pCubeName As %String, pDimName As %String) As %String

Given the logical name, pCubeName of a DeepSee cube, and a dimension name, return the name of the default Hierarchy (this is only defined if there is no more than one hierarchy for this dimension).

%GetDefaultLevel

ClassMethod %GetDefaultLevel(pCubeName As %String, pDimName As %String, pHierName As %String) As %String

Given the logical name, pCubeName of a DeepSee cube, and a dimension and hierarchy name, return the name of the default Level (this is only defined if there is no more than one level for this hierarchy).

%IsBaseCube

ClassMethod %IsBaseCube(pCubeName As %String) As %Boolean [ Internal ]

Given the logical name, pCubeName of a DeepSee cube known to exist, return true if it is a base cube (and not a Subject Area).

%GetBaseCube

ClassMethod %GetBaseCube(pCubeName As %String) As %String

Given the logical name, pCubeName of a DeepSee subject area known to exist, return its base cube.

%GetSourceClass

ClassMethod %GetSourceClass(pCubeName As %String) As %String

%GetRelatedCube

ClassMethod %GetRelatedCube(pCubeName As %String, pRelationName As %String) As %String

Given the logical name, pCubeName of a DeepSee cube, and the name of a relationship in the cube, return the name of the cube referred to by the relationship.

%IsRelationship

ClassMethod %IsRelationship(pCubeName As %String, pDimension As %String) As %Boolean

Given the logical name, pCubeName of a DeepSee cube, and the name of a dimension, test if the dimension is a relationship.

%GetDimensionList

ClassMethod %GetDimensionList(pCube As %String, ByRef pInfo, pIncludeCalcMbrs As %Boolean = 0, pUseInFilter As %Boolean = 0, pExtendedInfo As %Boolean = 0, pShowAll As %Boolean = 0) As %Status

Return a list of the dimensions (and measures) within the specified cube.
On return, pInfo will contain array of the form:
pInfo(DimNo,HierNo,LevelNo) = $LB(type,DimName,HierName,LevelName)
type can be "d","h","l","m","r" or "all" for dimension, hierarchy, level, measure, relationship or all level.
Note that all measures are found under DimNo 0 and have no LevelName. Dimensions whose name starts with "%" are not listed.
Dimensions that only contain calculated members are returned as:
pInfo(-1,hierNo,memberNo)
If pUseInFilter is true, then only return levels whose useInFilter flag is true.
If pExtendedInfo is true, also return $LB(factNumber, factID, SQL column ID, isEnabled, inProgress) settings.
If pShowAll is true, include hidden items in the return list.

%GetMemberTree

ClassMethod %GetMemberTree(pCube As %String, ByRef pTree, ByRef pVisited As %String, pSkipMeasures As %Boolean = 0, pRoot As %String = "", ByRef pLocalCalcMembers As %List, ByRef pLocalNamedSets As %List, pRelatedBy As %String = "", pLevel As %Integer = 0, pSkeleton As %Boolean = 0) As %Status

Get the members (dimensions, measures, and actual members of dimensions) of the specified cube as a tree format that can be displayed within a %ZEN.Component.dynaTree.
pCube is the cube name.
pTree is an array returned by reference that contains the member data.
pSkipMeasures is used internally and indicates that measures (as well as named filters) should not be listed.
pRoot is used to specify that an incremental load of children is requested; if provided it is the spec of a parent node.
pLocalCalcMembers is used to pass in additional calculated members.
pLocalNamedSets is used to pass in additional named sets.
pVisited and pRelatedBy are not used.
pSkeleton indicates that members and relationships are not displayed.

%GetPivotTree

ClassMethod %GetPivotTree(pCube As %String, ByRef pTree, pCurrPivot As %String = "") As %Status

Get list of saved pivots for a cube for display within a tree.

%GetQualityMeasureTree

ClassMethod %GetQualityMeasureTree(pCube As %String, ByRef pTree) As %Status

Get list of quality measures for display within a tree.

%CopyTree

ClassMethod %CopyTree(pName As %String, ByRef pTree, pParent As %Integer, ByRef pSource, pRoot As %Integer) As %Integer [ Internal ]

Copy source tree (from root) into pTree at the given parent node. Return number of nodes copied.

%GetDimensionInfo

ClassMethod %GetDimensionInfo(pCubeName As %String, pSpec As %String, Output pDimNo, Output pHierNo, Output pLevelNo, Output pRelationName As %String, Output pRelationSpec As %String, Output pSpecInfo As %String, ByRef pLocalCalcMembers, pStrict As %Boolean = 1, ByRef pLocalNamedSets) As %Status

Return the dimension,hierarchy, and level number of the specified element within the specified cube.
pCubeName is the name of the cube.
pSpec specifies the dimension in the form: "Dim.Hier.Level" or "Dim.Hier.Level.member".
If pStrict is false, then find a level: Hier or Level can be omitted if they are not ambiguous.
pSpecInfo is the array produced by parsing pSpec. This is returned as a convenience.
pLocalCalcMembers is an optional list of locally defined calculated members. pLocalNamedSets is an optional list of locally defined named sets.

%GetDimensionSpec

ClassMethod %GetDimensionSpec(pCubeName As %String, Output pSpec As %String, pDimNo As %Integer, pHierNo As %Integer = 0, pLevelNo As %Integer = 0) As %Status

Given the dimension,hierarchy, and level number for a dimension within the specified cube, return it's specification string.

%GetCubeMeasures

ClassMethod %GetCubeMeasures(pCube As %String, ByRef pMeasures, pSkipCalculated As %Boolean = 0) As %Status

Return the measures within the given cube as an array of form:
pMeasures(n) = $LB(name,caption,type,hidden,factName)
If pSkipCalculated is true, then do not include calculated measures.

%GetNamedFilters

ClassMethod %GetNamedFilters(pCube As %String, ByRef pFilters, pUseCubeVersion As %Boolean = 0) As %Status

Return all named filters for a given cube as an array of form:
pFilters(n) = $LB(name,tooltip,spec,cube)

%DeleteNamedFilter

ClassMethod %DeleteNamedFilter(pCube As %String, pFilterName As %String = "", pUseCubeVersion As %Boolean = 0) As %Status

Delete the given named filter for the given cube. If pFilterName is "*", then delete all named filters for the cube.

%GetNamedFilterInfo

ClassMethod %GetNamedFilterInfo(pCube As %String, pFilterName As %String, Output pInfo, pUseCubeVersion As %Boolean = 0) As %Status

Return details on the given named filter in the array pInfo.

%SaveNamedFilter

ClassMethod %SaveNamedFilter(pCube As %String, pFilterName As %String, pTooltip As %String, pSpec As %String, pUseCubeVersion As %Boolean = 0) As %Status

Save a named filter.

%GetSharedCalcMembers

ClassMethod %GetSharedCalcMembers(pCube As %String, ByRef pCalcMbrs, pUseCubeVersion As %Boolean = 0) As %Status

Return all shared calculated members for a given cube as an array of form:
pCalcMbrs(n) = $LB(name,tooltip,dimension,cube)

%DeleteSharedCalcMember

ClassMethod %DeleteSharedCalcMember(pCube As %String = "", pCalcMbrName As %String = "", pDimension As %String = "", pUseCubeVersion As %Boolean = 0) As %Status

Delete the given shared calculated member for the given cube. If pCalcMbrName is "*", then delete all shared calculated members for the cube.

%GetSharedCalcMemberInfo

ClassMethod %GetSharedCalcMemberInfo(pCube As %String, pDimension As %String = "", pCalcMbrName As %String = "", Output pInfo, pUseCubeVersion As %Boolean = 0) As %Status

Return details on the given shared calculated member in the array pInfo.

%SaveSharedCalcMember

ClassMethod %SaveSharedCalcMember(pCube As %String = "", pCalcMbrName As %String = "", pDimension = "", pValueExpression = "", pFormatString = "", pSolveOrder, pUseCubeVersion As %Boolean = 0) As %Status

Store the details of a calulated member in the shared location.

%GetPivotVariables

ClassMethod %GetPivotVariables(pCube As %String, ByRef pVariables, pUseCubeVersion As %Boolean = 0) As %Status

Return all pivot variables for a given cube as an array of form:
pVariables(n) = $LB(name,caption,defValue,context,desc)

%DeletePivotVariable

ClassMethod %DeletePivotVariable(pCube As %String, pVariableName As %String = "", pUseCubeVersion As %Boolean = 0) As %Status

Delete the given pivot variable for the given cube. If pVariableName is "*", then delete all pivot variables for the cube.

%GetPivotVariableInfo

ClassMethod %GetPivotVariableInfo(pCube As %String, pVariableName As %String, Output pInfo, pUseCubeVersion As %Boolean = 0) As %Status

Return details on the given pivot variable in the array pInfo.

%SavePivotVariable

ClassMethod %SavePivotVariable(pCube As %String, pVariableName As %String, ByRef pInfo As %String, pUseCubeVersion As %Boolean = 0) As %Status

Save a pivot variable. The variable's attributes are in the array pInfo.

%GetPivotVariableValues

ClassMethod %GetPivotVariableValues(pCube As %String, pVariableName As %String, Output pValues, pUseCubeVersion As %Boolean = 0) As %Status

Find all values for a given pivot variable.
Return pValues(n) = $LB(text,spec)

%GetCubeSearchableMeasures

ClassMethod %GetCubeSearchableMeasures(pCube As %String, ByRef pMeasures) As %Status

Return the searchable measures within the given cube as an array of form:
pMeasures(n) = $LB(name,caption,type)

%GetDimensionCaption

ClassMethod %GetDimensionCaption(pCube As %String, pDimNo As %Integer, pHierNo As %Integer, pLevelNo As %Integer, ByRef pCaption As %String) As %Status

Return the localized display name for a given element within the given cube.

%GetMemberCaption

ClassMethod %GetMemberCaption(pCube As %String, pDimName As %String, pHierName As %String = "", pLevelName As %String = "", ByRef pCaption As %String) As %Status

Return the localized display name for a given element within the given cube given a dimension, hierarchy, and level name.

%GetMemberDescription

ClassMethod %GetMemberDescription(pCube As %String, pDimName As %String, pHierName As %String = "", pLevelName As %String = "", ByRef pDescription As %String) As %Status

Return the localized description for a given element within the given cube given a dimension, hierarchy, and level name.

%MemberHasChildren

ClassMethod %MemberHasChildren(pCube As %String, pDimNo As %Integer, pHierNo As %Integer, pLevelNo As %Integer, ByRef pHasChildren As %Boolean) As %Status

Test if a given element within the given cube has child levels.

%GetMeasureFact

ClassMethod %GetMeasureFact(pCube As %String, pMeasureName As %String, Output pMeasureFact As %String) As %Status

Given a cube and a measure name, i.e. "Patient Count", return the fact table column name for that measured.

%GetDimensionFact

ClassMethod %GetDimensionFact(pCube As %String, pDimNo As %Integer, pHierNo As %Integer, pLevelNo As %Integer, ByRef pFactName As %String) As %Status

Return the fact name associated with a given element within the given cube.

%GetDimensionProperties

ClassMethod %GetDimensionProperties(pCube As %String, pDimName As %String, pHierName As %String, pLevelName As %String, ByRef pProperties) As %Status

Return the properties of a given level within the given cube as an array of form:
pProperties(n) = $LB(name,caption,type)

%GetCubeLevels

ClassMethod %GetCubeLevels(pCube As %String, ByRef pLevels, pSkipAll As %Boolean = 0, pSkipComputed As %Boolean = 0) As %Status

Return a list of all levels within the given cube.
On return pLevels contains a list of all levels of the form:
pLevels(n) = $LB(type,dimName,hierName,levelName)
Type is "l" for level, "m" for measure (in which case there is no levelName) or "r" for relationship (in which case there is only a dimension name).
If pSkipAll is true, do not return any "all" levels.
If pSkipComputed is true, do not return any levels for computed dimensions.

%GetCubeListings

ClassMethod %GetCubeListings(pCube As %String, Output pListings As %List, pType As %String = "") As %Status

Return an array of all (non-default) listings for the given cube. The array is of the form:
pListings(name) = $LB(caption,fields,order,type,source,edit)
If there are no listings, then pListings will be undefined.
If pType is defined, then only return listings of the given type.

%GetCubeListingFields

ClassMethod %GetCubeListingFields(pCube As %String, Output pFields As %List) As %Status

Return an array of all defined listing fields for the given cube. The array is of the form:
pListings(name) = $LB(caption,expression)
If there are no listing fields, then pFields will be undefined.

%GetDimensionMembers

ClassMethod %GetDimensionMembers(pCubeName As %String, pSpec As %String, pContext As %String = "", Output pMembers, pMaxMembers As %Integer = 100, Output pMemberClass As %String, ByRef pRelatedFilters, pCalcMode As %Integer = 0, pSearchKey As %String = "") As %Status

Return a list of members of the specified dimension for the specified cube.
pCubeName is the name of the cube.
pSpec specifies the dimension in the form: "Dim.Hier.Level".
pContext is used to indicate a particular calling context. This affects the behavior when trimming the list of members using related filters.
The list is returned via pMembers. This takes the form:
pMembers(n) = $LB(value,name,memberId,memberKey,[description])
Return the member class as a convenience.
If pRelatedFilters is provided, it is an array of other filter values to use to restrict the set of members. It takes the form:
pRelatedFilters(spec) = key
If pCalcMode is 1, then only return calculated members. If pCalcMode is -1, then only return non-calculated members.

%FilterSpecToArray

ClassMethod %FilterSpecToArray(pCube As %String, pSpec As %String, ByRef pFilterArray) As %Status

Convert a string pSpec into array form and add it to the array pFilterArray. The value for pSpec may be any valid MDX WHERE clause referencing non-calculated members. If a member being inserted into the array already exists, the selection data will be replaced by the intersection of the preexisting member or set and the new member or set provided by the argument.

%SlicerNodeToSpecArray

ClassMethod %SlicerNodeToSpecArray(node As %DeepSee.Query.node, ByRef pFilterArray) As %Status [ Internal ]

Perfroms the actual work of recursively walking a slicer tree and representing it as an array if possible. Contents of the pFilterArray can be returned in two different forms:
Single argument: pFilterArray(levelSpec) = key
heterogeneous %OR: pFilterArray(ORText,levelSpec) = key

%GetLevelNameForKey

ClassMethod %GetLevelNameForKey(pCubeName As %String, pSpec As %String, pKey As %String, Output pValue As %String) As %Status

Give a cube, a level within the cube, and the key value of a member of the level, return the name of the level member.
pCubeName is the name of the cube.
pSpec specifies the dimension in the form: "Dim.Hier.Level".
pKey is a key value. This may include the &[] around the key value.
pValue is the returned display value.

%ParseKeyForDisplay

ClassMethod %ParseKeyForDisplay(pKey As %String, Output pValue As %String, pKPIClass As %String = "", pFilterName As %String = "") As %Status

Parse a filter key value and convert all keys to display values in the context of pKPIClass.

%GetMemberKeyForID

ClassMethod %GetMemberKeyForID(pCubeName As %String, pDimNo As %Integer, pHierNo As %Integer, pLevelNo As %Integer, pID As %String, Output pKey As %String) As %Status [ Internal ]

Given a cube and the dimension, heirarchy, and level numbers, translate the member ID into the member key. pCubeName is the name of the cube.
pID is an ID in the dimension's star table.
pKey is the returned key corresponding to that ID.

%GetModel

ClassMethod %GetModel(pCubeName As %String, Output pStatus As %Status) As %DeepSee.Model.cube

Given the logical name, pCubeName of a DeepSee cube, return an instance of the %DeepSee.Model.cube meta-data object that describes the cube.
Return "" if the given cube does not exist.
When called on a subject area, this redirects to %GetSubjectAreaModel.

%GetSubjectAreaModel

ClassMethod %GetSubjectAreaModel(pName As %String, Output pStatus As %Status) As %DeepSee.Model.SubjectArea.subjectArea

Given the logical name, pName of a DeepSee subject, return an instance of the %DeepSee.Model.SubjectArea.subjectArea meta-data object that describes the cube.
Return "" if the given cube does not exist.
This method does not work on base cubes; use %GetModel.

%GetFunctionSet

ClassMethod %GetFunctionSet(ByRef funcset, pClass As %String) As %Status

Builds a list of functions (methods) for a given FunctionSet class This list is returned in funcset.
The list is of the form list(NAME) = $LB(class,name,specparsed,return).
This method is not currently used. [Previously private]

%GetTimeLevelClasses

ClassMethod %GetTimeLevelClasses(Output pClasses) As %Status

Builds a list of available time level classes. The list is of the form pClasses(calendar,NAME) = class. [Previously private]

%GetTimeLevelType

ClassMethod %GetTimeLevelType(pClassName As %String) As %String

Protected lookup of the type of a time function. If the argument pClassName is not a valid time class (extends %DeepSee.Time.AbstractLevel), then the method returns an empty string.

%GetTimeLevelCalendar

ClassMethod %GetTimeLevelCalendar(pClassName As %String) As %String

Protected lookup of the calendar used for a time function. If the argument pClassName is not a valid time class (extends %DeepSee.Time.AbstractLevel), then the method returns an empty string.

%ExcelFormatDate

ClassMethod %ExcelFormatDate(pDate As %String, pCalendar As %String) As %String

Given a date in $H format and a calendar, return the number of days since Jan 0 1900 This is excel's version of $H and is needed to export dates as dates to excel

%Analyze

ClassMethod %Analyze(pCubeName As %String, pFlags As %String = "i", pVerbose As %Boolean = 1) As %Status

Loop over all indices for a given cube and show details.
pCubeName is the name of the cube.
pFlags is a set of flags that can control what is analyzed: flags include "i" (include indices), "f" (include facts), "c" (include cell cache). The default is "i".
pVerbose indicates that status information is to be displayed while the analysis is done.

%AnalyzeMissing

ClassMethod %AnalyzeMissing(pCube As %String) As %Status

Examine the levels and measures for a given cube and report on how many missing values there are.
pCubeName is the name of the cube.

%GetDimensionTables

ClassMethod %GetDimensionTables(pCubeName As %String, Output pStarTables, pCardinality As %Boolean = 0) As %Status

Return an array of the dimension tables (class names) used for a given cube. If pCardinality is true, compute the size of each table.

%BuildDimensionTableIndices

ClassMethod %BuildDimensionTableIndices(pCubeName As %String, pVerbose As %Boolean = 1) As %Status

Rebuild the indices for every dimension table used for cube pCubeName. If pCubeName is "*", then perform this on every cube within the current namespace that is visible to the current user.

%ReadFacts

ClassMethod %ReadFacts(pCubeName As %String, pStartId As %Integer, pEndId As %Integer) [ Internal ]

Read portion of fact table into memory. Used during index loading.

%CompressIndices

ClassMethod %CompressIndices(pCubeName As %String, pVerbose As %Boolean = 0) As %Status

Loop over all indices for the given cube and compress them.

%DenormalizeType

ClassMethod %DenormalizeType(pType As %String) As %String [ CodeMode = expression ]

Convert a class name of the form %Library.xxx to %xxx.

%GetSQLTableName

ClassMethod %GetSQLTableName(pClass As %String, pVerifyExists = 0) As %String

Returns the SQL table name for class pClass. Returns the empty string if the supplied pClass does not have an associated table.

%GetSQLColumnName

ClassMethod %GetSQLColumnName(pClass As %String, pProp As %String) As %String [ Final ]

Returns the SQL name of property pProp for class pClass.

%GetCubeList

ClassMethod %GetCubeList(Output pList, pType As %String = "", pNonAbstract As %Boolean = 0, pBaseCube As %String = "") As %Status [ Final ]

Return an array of all currently defined DeepSee Cubes visible to the current user. This is used by utilities.
This array takes the form:
pList(NAME) = $LB(name,caption,moddate,type)
pType, if defined, can be "cubes" or "subjectAreas". This will limit the returned list to those item types.
pNonAbstract, if true, limits the returned items to non-abstract cubes.
pBaseCube, if provided, limits the returned items to the base cube and its descendants.
If there are no cubes, then pList will be undefined.

%GetCubeListArray

ClassMethod %GetCubeListArray(ByRef pParameters, Output pMetaData, Output %pData, pType As %String = "", pNonAbstract As %Boolean = 0) As %Status [ Final, Internal ]

Return an array of all currently DeepSee Cubes and subject areas in a format that can be used by a finderDialog. pType, if defined, can be "cubes" or "subjectAreas". This will limit the returned list to those item types. pNonAbstract, if true, limits the returned items to non-abstract cubes.

%GetPivotListArray

ClassMethod %GetPivotListArray(ByRef pParameters, Output pMetaData, Output %pData) As %Status [ Final, Internal ]

Return an array of all currently defined DeepSee Pivots in a format that can be used by a finderDialog.

%GetDashboardListArray

ClassMethod %GetDashboardListArray(ByRef pParameters, Output pMetaData, Output %pData) As %Status [ Final, Internal ]

Return an array of all currently defined DeepSee dashboards in a format that can be used by a finderDialog.

%GetKPIListArray

ClassMethod %GetKPIListArray(ByRef pParameters, Output pMetaData, Output %pData) As %Status [ Final, Internal ]

Return an array of all currently defined, public DeepSee KPIs in a format that can be used by a finderDialog.

%GetWorksheetListArray

ClassMethod %GetWorksheetListArray(ByRef pParameters, Output pMetaData, Output %pData) As %Status [ Final, Internal ]

Return an array of all currently defined DeepSee Worksheets in a format that can be used by a finderDialog.

%GetMetricListArray

ClassMethod %GetMetricListArray(ByRef pParameters, Output pMetaData, Output %pData) As %Status [ Final, Internal ]

Return an array of all currently defined Business Metrics in a format that can be used by a finderDialog.

%BuildItemListArray

ClassMethod %BuildItemListArray(ByRef pList, Output pMetaData, Output %pData, ByRef pParameters) As %Status [ Final, Internal ]

Helper method. Convert the items in pList into an array that can be used by a finderDialog.

%GetFunctionList

ClassMethod %GetFunctionList(Output pList, pAsTree As %Boolean = 0) As %Status [ Final ]

Return a list of all currently defined MDX functions. This is used by utilities.
If pAsTree is true, return a format that a tree control can consume.

%TestTimeClass

ClassMethod %TestTimeClass(pClassName As %String, pTest As %Integer = 1, pFormat As %String = "") As %Status

This utility method tests a DeepSee time level class to verify that it is implemented correctly.
There are several tests:
Test 1: test the %Convert, %KeyToValue, and %ValueToKey methods.
Test 2: test the %Convert, %KeyToValue, and %ValueToKey methods.

%LoadCellCache

ClassMethod %LoadCellCache(pCubeName As %String) As %Status

Compute pre-loaded cell cache entries for the given cube based on the cell cache specification within the cube's definition.

%ComputeCellCache

ClassMethod %ComputeCellCache(pCubeName As %String, ByRef pSpec) As %Status

Generate and execute a query that will force the update of the cell cache for given cube and levels.

%ParseRangeExpression

ClassMethod %ParseRangeExpression(pRange As %String, Output pOutput, pContext As %String = "", Output pCode As %String) As %Status

Parse the given DeepSee range expression.
A range expression takes the form:
spec:replace;spec:replace;
spec takes the form:
value | (value,value) | [value,value]
() specifies a non-inclusive edge of a range.
[] specifies a inclusive edge of a range.
pContext is used for error reporting. pCode contains a generated expression that implement the range expression (using x as an input value).

%ExpandRangeMacro

ClassMethod %ExpandRangeMacro(ByRef pReplace As %String, pExp As %String, pContext As %String = "") As %Status [ Private ]

%KillLogFile

ClassMethod %KillLogFile(pFileName As %String = "DeepSeeTasks") As %Status [ Internal ]

Delete the given DeepSee log file.

%WriteToLog

ClassMethod %WriteToLog(pSource As %String = "", pMsg As %String = "", pFileName As %String = "DeepSeeTasks") As %Status [ Internal ]

Appends an error message to a DeepSee log file within the log directory. This method uses locks to support simultaneous updates from from multiple processes.
pSource is the source of the error.
pMsg is the error message.
pFileName is the name of the log file. This should not include a file path or file extension.

%GetLogFileName

ClassMethod %GetLogFileName(pFileName As %String = "DeepSeeTasks") As %String [ Internal ]

Return the full name of a DeepSee log file.

%GetDataSourceTree

ClassMethod %GetDataSourceTree(pClass As %String, Output pTree, ByRef pParms, pLevel As %Integer = 0, pParentRef As %String = "", pRoot As %String = "") As %Status

Return the properties of a cube data source in a format that can be consumed by a Zen dynaTree control.
pRoot is used to specify that an incremental load of children is requested; if provided it is the spec of a parent node.

%SaveCubeDefinition

ClassMethod %SaveCubeDefinition(pClassName As %String, pSuper As %String = "", pDesc As %String, pModel As %DeepSee.Model.cube, pDomain As %String = "", pDependsOn As %String = "") As %Status [ Internal ]

Utility method to create and save a cube definition class. Used by Architect.

%SaveSubjectAreaDefinition

ClassMethod %SaveSubjectAreaDefinition(pClassName As %String, pSuper As %String = "", pDesc As %String, pModel As %DeepSee.Model.SubjectArea.subjectArea, pDomain As %String = "", pDependsOn As %String = "") As %Status [ Internal ]

Utility method to create and save a subject area definition class. Used by Architect.

%GetPivotList

ClassMethod %GetPivotList(Output pList, pHidden As %Boolean = 0, pCubeName As %String = "") As %Status [ Final ]

Return a list of all currently defined DeepSee Pivots visible to the current user. This is used by utilities.
This list takes the form:
pList(NAME) = $LB(name,caption,moddate,type)
If pHidden is true, then include trash and local items.
If pCubeName is provided, then only list pivots based on it.

%GetDashboardList

ClassMethod %GetDashboardList(Output pList) As %Status [ Final ]

Return a list of all currently defined DeepSee dashboards visible to the current user. This is used by utilities.
This list takes the form:
pList(NAME) = $LB(name,caption,moddate,type)

%ConvertDate

ClassMethod %ConvertDate(pDate As %String, pDateType As %String) As %Date

Utility method. Convert a date value to %Date ($H) format.
pDateType indicates the incoming date format.

%SetAgentCount

ClassMethod %SetAgentCount(pNumAgents As %Integer = "", pType = "build", Output pStatus As %Status) As %Integer

Set the default number of background processes used by DeepSee for the group specified by pType. Tasks executed by background agents are divided into "build" and "runTime" groups. This method can be used to set a per-group limit or to set a maximum number of processes that may be active across multiple groups. The limits can be set with the following value for pType:
- "build" - number of agents that will be requested for a single worker group performing cube build tasks
- "runTime" - number of agents that will be requested for queries and processing of user code such as KPIs
- "buildMax" - the maximum number of agents that can be active for user tasks
- "runTimeMax" - the maximum number of agents that can be active for user tasks

%GetAgentCount

ClassMethod %GetAgentCount(pType = "build", Output pStatus As %Status) As %Integer

Get the current default agent count for the group specified by pType. pType can be used to query any of the limits:
- "build" - number of agents that will be requested for a single worker group performing cube build tasks
- "runTime" - number of agents that will be requested for queries and processing of user code such as KPIs
- "buildMax" - the maximum number of agents that can be active for build tasks
- "runTimeMax" - the maximum number of agents that can be active for user tasks

%SetDSTimeIndex

ClassMethod %SetDSTimeIndex(pClassName As %String, pObjectId As %String, pAction As %Integer, pInterval As %Integer = 0)

Set an entry into the DS Time index used to track changes to transactional classes.
This is intended for classes that use DSTIME="manual" and wish to maintain the DSTIME index manually. It should be called whenever an instance of the class is inserted, updated, or deleted.
pClassName is the (case-sensitive) class name of the transactional class.
pObjectId is object id of the affected object instance.
pAction is 0 for updates, 1 for inserts, and 2 for deletes.
pInterval is the time interval value corresponding to the DSINTERVAL parameter. If this is not greater than zero then a standard DSTIME index entry is set, otherwise a DSINTERVAL index entry is set.

%GetErrorPageURL

ClassMethod %GetErrorPageURL(pError As %String) As %String

Return the URL for the DeepSee management portal error page.

%GetCollectionProjections

ClassMethod %GetCollectionProjections(pClassname As %String, ByRef pProjectedClass As %String(MAXLEN=255)) As %Status

Given a class name, return the set of classes projected for collection properties of the class.

%AddTimeInterval

ClassMethod %AddTimeInterval(pDate As %Date, pInterval As %String) As %Date

Add a time interval to a given date (in $H format).
The interval is of the form "99y99m99d" (years, months, and days). There can be a leading minus sign.

%DaysInMonth

ClassMethod %DaysInMonth(y, m) As %Integer

Return number of days in the given year and month.

%HijriDaysInMonth

ClassMethod %HijriDaysInMonth(y = "", m = "", calendar = "hijriTabular") As %Integer

Return number of days in the given year and month.

%AddHijriTimeInterval

ClassMethod %AddHijriTimeInterval(pDate As %Date, pInterval As %String, pCalendar As %String = "hijriTabular") As %Date

Add a time interval to a given date (in $H format).
The interval is of the form "99y99m99d" (years, months, and days). There can be a leading minus sign.

%IsLeapYear

ClassMethod %IsLeapYear(y) As %Boolean

Return whether the given year is a leap year.

%IsHijriLeapYear

ClassMethod %IsHijriLeapYear(y, calendar = "hijriTabular") As %Boolean

Return whether the given year is a leap year.

%FormatDate

ClassMethod %FormatDate(pDate As %Date, pFormat As %String = "") As %String

Format a date value (in $H format) according to the format in pFormat.
The format string can contain:
"y" - Year number (4 digits).
"q" - Quarter number.
"m" - Month number, with no leading zero.
"mm" - Month number, with leading zero.
"mmm" - Short name of month (using server locale).
"mmmm" - Long name of month (using server locale).
"d" - Day number, with no leading zero.
"dd" - Day number, with leading zero.
"ddd" - Short name of day (using server locale).
"dddd" - Long name of day (using server locale).
"\x" - display character "x"
" " - space
"/" - "/"
"-" - "-"
"." - "."

%UnformatDate

ClassMethod %UnformatDate(pValue As %String, pFormat As %String = "") As %Date

Unformat a date value according to the given format and convert to $H (or "").
See %FormatDate for information on formats.

%FormatPartialDate

ClassMethod %FormatPartialDate(pDate As %String = "", pFormat As %String = "") As %String

Format a date value (in partial date ODBC format) according to the format in pFormat.
The format string can contain:
"y" - Year number (4 digits).
"q" - Quarter number.
"m" - Month number, with no leading zero.
"mm" - Month number, with leading zero.
"mmm" - Short name of month (using server locale).
"mmmm" - Long name of month (using server locale).
"d" - Day number, with no leading zero.
"dd" - Day number, with leading zero.
"ddd" - Short name of day (using server locale).
"dddd" - Long name of day (using server locale).
"\x" - display character "x"
" " - space
"/" - "/"
"-" - "-"
"." - "."
Missing pieces are replaced with the localized text "Unknown".

%UnformatPartialDate

ClassMethod %UnformatPartialDate(pValue As %String, pFormat As %String = "") As %Date

Unformat a date value according to the given format and convert to $H (or "").
See %FormatDate for information on formats.

%DayOfWeekToNumber

ClassMethod %DayOfWeekToNumber(pDayName, pFullName As %Boolean = 1, pLocale As %String = "")

Method to convert day of week name to a number from 1 to 7
pDayName: full day name (e.g. Monday) or day short name (e.g. Mon)
pFullName: If true pDayName is the full day name: if false, pDayName is the short day name
pLocale: if not specified, default to current locale.

%Shell

ClassMethod %Shell()

Invoke the DeepSee command line shell.

%UpdateDimensionProperty

ClassMethod %UpdateDimensionProperty(pCubeName As %String, pSpec As %String, pValue As %String, pKey As %String) As %Status

Programmatic API for updating the value of a dimension property after a cube has been built. Set tSC = ##class(%DeepSee.Utils).%UpdateDimensionProperty( "Holefoods","[Outlet].[H1].[Region].&[Asia]","Asia2") It takes the following arguments:
pCubeName-name of the cube.
pSpec-specification of member to update as an MDX expression. This must completely specify a level and a single key value within the level. For example: "[Product].[P1].[Product Category].&[Candy]"
You can set the value of a dimension property by adding Properties(propName) to the end of the spec: "[Outlet].[H1].[City].&[23].Properties(""Population"")" pValue-if defined, this is new NAME value for a dimension member or the value to use for a dimension property.
pKey-if defined, this is new KEY value for a dimension member. Ignored for a dimension property.
There a number of restrictions on this method:
You cannot update a time dimension.
You cannot update a member of relationship.
You cannot update a level property whose isReference is true.

%WriteDependencyGraph

ClassMethod %WriteDependencyGraph(pCubeName As %String)

Write the cube dependency graph for the given cube.

%GetDependencyGraph

ClassMethod %GetDependencyGraph(ByRef pGraph, pCubeName As %String, pDirection As %String = "", pLevel As %Integer = 0) As %Status

Get the cube dependency graph for the given cube: pGraph(cube, dependentCube) = ""

%FindDimensionTableForProperty

ClassMethod %FindDimensionTableForProperty(pCubeName As %String, pSourceProp As %String, Output pList) As %Status [ Internal ]

Given a cube and a source property name, return the list of dimension tables that make use of the source property.

%GetPaperSizeList

ClassMethod %GetPaperSizeList(Output pList) As %Status [ Internal ]

Return list of standard paper sizes in the form:
pList(n) = $LB(name,size)
Where size is "WxH units", e.g., "8.5x11 in"

%ExportExcelToFile

ClassMethod %ExportExcelToFile(pFile As %String, ByRef pParms As %String) As %Status

Export a DeepSee query or KPI to the file pFile in CSV format.
pParms controls the content and display of the export.
pParms("TITLE") = title
pParms("SUBTITLE") = subtitle
pParms("SHOWDATE") = "on" (includes current date and time in the export)
Data export should rely on either a base MDX query or an available KPI.
pParms("MDX") = MDX Statement to execute
pParms("KPI") = KPI class name
Exports operating in MDX mode expect filter clauses to be included in the query. When filters are being applied to the KPI class, they may be provided in the array:
pParms("FILTER",filterName) = filterValue
Filters can optionally be included as a printed table in the export, provided by the FILTERNAMES and FILTERVALUES parameters:
pParms("FILTERNAMES") = A $C(10)-delimited list of filter names to display
pParms("FILTERVALUES") = A $C(10)-delimited list of filter values to display

Defined listings can be applied to a resultset using:
pParms("LISTINGNAME") = Name of a listing to execute.
A KPI must support use of a named listing or else this will be ignored. An MDX query must be in DRILLTHROUGH mode and the cube must have that listing defined for the listing to be applied.

%ExportPDFToFile

ClassMethod %ExportPDFToFile(pFile As %String, ByRef pParms As %String) As %Status

Export a DeepSee query or KPI to the file pFile in CSV format.
pParms controls the content and display of the export.
pParms("TITLE") = title
pParms("SUBTITLE") = subtitle
pParms("SHOWDATE") = "on" (includes current date and time in the export)
Data export should rely on either a base MDX query or an available KPI.
pParms("MDX") = MDX Statement to execute
pParms("KPI") = KPI class name
Exports operating in MDX mode expect filter clauses to be included in the query. When filters are being applied to the KPI class, they may be provided in the array:
pParms("FILTER",filterName) = filterValue
Filters can optionally be included as a printed table in the export, provided by the FILTERNAMES and FILTERVALUES parameters:
pParms("FILTERNAMES") = A $C(10)-delimited list of filter names to display
pParms("FILTERVALUES") = A $C(10)-delimited list of filter values to display

Defined listings can be applied to a resultset using:
pParms("LISTINGNAME") = Name of a listing to execute.
A KPI must support use of a named listing or else this will be ignored. An MDX query must be in DRILLTHROUGH mode and the cube must have that listing defined for the listing to be applied.

%ExportCSVToFile

ClassMethod %ExportCSVToFile(pFile As %String = "", ByRef pParms As %String, Output pOutFile) As %Status

Export a DeepSee query or KPI to the file pFile in CSV format.
pParms controls the content and display of the export.
pParms("TITLE") = title
pParms("SUBTITLE") = subtitle
pParms("SHOWDATE") = "on" (includes current date and time in the export) pParms("SIMPLE") = 1 (exports only the data table without any filter or title information)

Data export should rely on either a base MDX query or an available KPI.
pParms("MDX") = MDX Statement to execute
pParms("KPI") = KPI class name
Exports operating in MDX mode expect filter clauses to be included in the query. When filters are being applied to the KPI class, they may be provided in the array:
pParms("FILTER",filterName) = filterValue
Filters can optionally be included as a printed table in the export, provided by the FILTERNAMES and FILTERVALUES parameters:
pParms("FILTERNAMES") = A $C(10)-delimited list of filter names to display
pParms("FILTERVALUES") = A $C(10)-delimited list of filter values to display

Defined listings can be applied to a resultset using:
pParms("LISTINGNAME") = Name of a listing to execute.
A KPI must support use of a named listing or else this will be ignored. An MDX query must be in DRILLTHROUGH mode and the cube must have that listing defined for the listing to be applied.

%ComputeAge

ClassMethod %ComputeAge(pStart As %Date, pEnd As %Date, pUnits As %String = "years") As %Integer

Compute the "age" (time difference) between pStart and pEnd as a number of units specified by pUnits ("years","months","days").

%CreateQueryNonce

ClassMethod %CreateQueryNonce(pText As %String, pMode As %String = "MDX") As %String

Sometimes we need to pass a query (or XML) to another process via a URL. I.E. has trouble with large URL parameters, so the best approach is to store the query text in a global and pass a one-time token (or nonce) as part of the URL. Assumes that the query is encrypted. Returns "ERROR:"_details if there is an error.

%CreateParameterNonce

ClassMethod %CreateParameterNonce(pParm As %String) As %String

Sometimes we need to pass parameters to another process via a URL. I.E. has trouble with large URL parameters, so the best approach is to store the parameter text in a global and pass a one-time token (or nonce) as part of the URL. Assumes that the parm unencrypted. Returns "ERROR:"_details if there is an error.

%GetParameterNonce

ClassMethod %GetParameterNonce(pNonce As %Integer)

%FindCubeMembers

ClassMethod %FindCubeMembers(pCube As %String, pSearchKey As %String, Output pMembers, pDimList As %String = "", pIncludeLevelNames As %Boolean = 0, pIncludeMeasures As %Boolean = 0, pIncludeComputed As %Boolean = 0, pMaxResults As %Integer = 10) As %Status

Utility method to retrieve pMaxResults cube members based on a simple search key. By default, this method will return normal cube members only, but a range of flags serve to indicate which type of results to return on top, as long as they match the search key (level names, measure names or computed members).
Members are returned as

pMembers(n) = $lb(Caption, Spec, ["measure"|"level"|"member"])

Use pDimList to limit the search scope to those dimensions, hierarchies or levels listed in this comma-separated list of specs.

This method does not return "all" levels, nor will it check cube relationships.

GetResourceList

ClassMethod GetResourceList() As %String

Return resource list containing type=Application only.

%CompressList

ClassMethod %CompressList(pFactId As %String) As %String [ Internal ]

Given a fact id, see if there are any or groups (1|2|3) that can be compressed into ranges.

%TestForZProcessing

ClassMethod %TestForZProcessing(pKill As %Boolean = 0) [ Internal ]

Diagnostic.

%IsDeepSeeEnabled

ClassMethod %IsDeepSeeEnabled(pNamespace = "") As %Boolean

Indicates whether the default application for this namespace will process DeepSee Pages.

%IsDataConnector

ClassMethod %IsDataConnector(pClassName As %String = "", pStatus As %Status) As %Boolean

Test whether pClassName is a DataConnector. This uses a direct global lookup so users do not need to rely on access to %Dictionary tables

%GetMDXFromPivot

ClassMethod %GetMDXFromPivot(pPivotFullName = "", Output pStatus As %Status, pExecute As %Boolean = 0, ByRef pParms, Output pResultSet As %DeepSee.ResultSet) As %String

Method for programmatically creating a pivot table
The GetMDXforPivot method returns the MDX query for saved pivot.

Arguments:

  • pPivotFullName The name of the pivot including folder name
    Format: folder/pivot name
    Example: My Folder/My Pivot

  • pExecute Boolean value (optional):
    0 - Do not execute the MDX query (Default)
    1 - Execute the MDX query

  • pResultSet Output argument (optional):
    Instance of %DeepSee.ResultSet for the MDX query:
    This can be used to access the query results, meta data, statistics, etc.
    To get the text of the MDX query, use only the pPivotFullName argument
    To get the text of the MDX query and run the query, use pPivotFullName and pExecute
    To get the text of the MDX query, run the query, and get the ResultSet, use pPivotFullName, pExecute and pResultSet

%ExecutePivot

ClassMethod %ExecutePivot(pPivotFullName = "", ByRef pParms, Output pResultSet) As %Status

Programmatically execute a stored pivot table. The pPivotTableName is the full Folder/SubFolder/Name of the pivot table. Execute parameters may optionally be passed in through the pParms array. If desired, the resultset constructed in the execution procedure can be returned using pResultSet.

%GetResultSetFromPivot

ClassMethod %GetResultSetFromPivot(pPivotFullName = "", Output pStatus As %Status, pExecute As %Boolean = 0, ByRef pParms, Output pMDX) As %DeepSee.ResultSet

Programmatically create an instance of a %DeepSee.ResultSet from a stored pivot table. The pPivotTableName is the full Folder/SubFolder/Name of the pivot table. By default, the query is only prepared and returned ready for execution. The query can be asynchronously executed as part of the retrieval process by setting pExecute=1. Execute parameters may optionally be passed in through the pParms array.

%GetChildSpec

ClassMethod %GetChildSpec(pItemList As %String, pCubeName As %String, pAxisNo As %Integer = 0, Output pChildSpec As %String = "") As %Status

%ProcessCubeListArrayNode

ClassMethod %ProcessCubeListArrayNode(ByRef pNode, pCurrentString = "", ByRef pValueList = "") As %Status [ Internal ]

Convert a node of the graph returned by %GetCubeListArray into a comma-delimited valueList. This may be called on the graph itself.

%ParseSQLFieldList

ClassMethod %ParseSQLFieldList(pFieldString = "", pDomain = "", Output pFieldArray, pLocalize As %Boolean = 0) As %Status

Split a single fieldList string into the individual fields. The output pFieldArray returns each SELECT item in pFieldArray(termNumber) = $LB( $LB(fieldIdenitifier,"AS",logicalHeader), $LB(fieldIdenitifier,"AS",displayHeader)) The pLocalize parameter can be used to request behavior of the $$$TEXT macro in the header portion: 0 - Return the original text value from $$$TEXT 1 - Return the header value localized to the language of the current client When pLocalize is used, a default domain can be provided in pDomain. This domain will be used for translation for each instance of $$$TEXT that does not specify its own domain.

%ArrayToList

ClassMethod %ArrayToList(ByRef pParms, Output pParmsList As %List) As %Status

Convert a single-subscript array to an $LB format

%ArrayFromList

ClassMethod %ArrayFromList(pParmsList As %List = {$LB()}, ByRef pParms) As %Status

Convert a parameters list in $LB format to an array

%IsValidFactList

ClassMethod %IsValidFactList(pCube As %String = "", pFactList As %String = "", Output pStatus As %Status, pReason As %String = "") As %Boolean

Test a pFactList to make sure it contains only SQL column identifiers that are actually defined in pCube.

%NormalizeFactList

ClassMethod %NormalizeFactList(pFactList = "", Output pStatus As %Status, pCubeName = "") As %List

Take as input a pFactList in either comma-delimited string or $LB format and return a fact list in $LB format with any empty entries removed. If pCubeName is supplied, any supporting fields that are required to produce a successful Selective Build given the cube definition are added to the original list.

%ReinforceFactList

ClassMethod %ReinforceFactList(pCubeIndex = "", ByRef pFacts) As %Status [ Internal ]

This examines an array of facts for a given cube as provided in pFacts - For levels in a hierarchy all parent levels in that hierarchy will also be included in the list. - For time levels the common reference column in the fact table on which the time functions operate will also be added to the list.

%FindCubeIndexList

ClassMethod %FindCubeIndexList(pCubeName = "", Output pStatus As %Status, pFactList = "") As %List [ Internal ]

Provided a pCubeName and a valid pFactList for that cube, return the list of buildable indices contained in the original fact list. If no fact list is supplied, the method returns a null string.
This is best used following normalization of the fact list using %NormalizeFactList method with the cubename suplied.

%LockFactList

ClassMethod %LockFactList(pCubeName As %String, pFactList As %List, ByRef pLocked, pLockTimeout = 1) As %Status

Take out locks for the specific column identifiers in a pFactList under the synchronze lock. This will prevent a general build or a synchronize but will not prevent selected updates of other columns in the fact table.

%UnlockFactList

ClassMethod %UnlockFactList(pCubeName As %String, pFactList As %List) As %Status

Release the update locks for the selected fact list.

%MarkFactsEnabled

ClassMethod %MarkFactsEnabled(pCubeName As %String = "", pFactList As %String = "", pEnabled = 1, pInProgress = 0) As %Status

Mark dimensions as enabled or disabled according to pEnabled. If the fact list is not supplied, mark all as enabled. Otherwise, mark only the dimensions supplied in the fact list.
This method can also optionally mark that a dimension is in the process of updating using the pInProgress paraeter.

%IsFactEnabled

ClassMethod %IsFactEnabled(pCubeName As %String = "", pSpec As %String = "", Output pStatus As %Status, Output pFactName As %String, Output pInProgress) As %Boolean

Check to see if a given dimension is currently queryable for a given cube.

%IsValidCubeName

ClassMethod %IsValidCubeName(pCubeName As %String = "", Output pReason) As %Boolean

Test the raw string to verify it is a valid cube name. A valid cube name must begin with an alpha-numeric character or an underscore. Remaining characters in the cube name must be alpha-numeric, space, underscore, period, slash, and colons.

%AtScaleExportCube

ClassMethod %AtScaleExportCube(pCubeName As %String = "", pFileName As %String = "", pCalendar As %String = "") As %Status

Produce a serialized representation of the cube model suitable for import to an AtScale environment. The JSON output will be saved in the file pFileName.
If a calendar has been created to support time dimensions in the AtScale environment, that can be passed in via pCalendar using either table or class reference syntax.