|
Class Reference
%DeepSee.Utils
|
|
![]() |
|||
Private Storage |
This class contains a number of DeepSee utility methods.
|
|
|
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.
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.
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.
Update all facts in the DeepSee cube pCubeName with data from the source table.
This will delete any information currently in the cube. If pAsync is true, then background tasks are used.
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.
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.
Test that the current user holds privileges on the given cube.
Loop over all indices for the given cube and compress them.
Loop over fact table for cube and precompute the aggregates for the specified combinations in pCombo.
pCombo(n) = "FactName1,FactName2,MsrName1"
Precompute the aggregates witin the given cube and the given group name within the cube's CellCache specification.
Set pGroupName to "*" for all groups.
Generate and execute a query that will force the update of the cell cache for given cube and levels.
Utility method. Convert a date value to %Date ($H) format.
pDateType indicates the incoming date format.
Given the logical name, pCubeName of a DeepSee cube, test if it exists.
Return number of days in the given year and month.
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.
Delete the given named filter for the given cube. If pFilterName is "*", then delete all named filters for the cube.
Convert a class name of the form %Library.xxx to %xxx.
Export a DeepSee query or KPI to the file pFile in excel format.
pParms defines the export parameters:
pParms("TITLE") = title
pParms("SUBTITLE") = subtitle
pParms("MDX") = MDX Statement
pParms("KPI") = KPI class name
pParms("LISTINGNAME") = Listing name
pParms("FILTERNAMES") = $C(10)-delimited list of filter names
pParms("FILTERVALUES") = $C(10)-delimited list of filter values
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
"/" - "/"
"-" - "-"
"." - "."
Get the current default agent count.
Given the logical name, pCubeName of a DeepSee subject area known to exist, return its base cube.
Given a class name, return the set of classes projected for collection properties of the class.
Given the logical name, pCubeName of a DeepSee cube, return the display name of its %COUNT measure.
Given the logical name, pCubeName of a DeepSee cube, return the logical name of its %COUNT measure.
Given the logical name, pCubeName of a DeepSee cube, return the class name of it associated actionClass, if any.
Given the logical name, pCubeName of a DeepSee cube, return its caption.
Given the logical name, pCubeName of a DeepSee cube, return the class name of the cube definition.
Given the logical name, pCubeName of a DeepSee cube return its class description.
Given the logical name, pCubeName of a DeepSee cube, return the class name of its fact table.
Given the logical name, pCubeName of a DeepSee cube, return the number of rows within its fact table.
Given the logical name, pCubeName of a DeepSee cube, return the SQL name of its fact table.
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.
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.
Return an array of all (non-default) listings for the given cube. The array is of the form:
pListings(name) = $LB(caption,fields,order)
If there are no listings, then pListings will be undefined.
If pType is defined, then only return listings of the given type.
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.
Given the logical name, pCubeName of a DeepSee cube, return the number of members within the given dimension level.
Given the logical name, pCubeName of a DeepSee cube, return the date of the time the cube definition was modifed.
Given the logical name, pCubeName of a DeepSee cube, return its name in its original case.
Return the searchable measures within the given cube as an array of form:
pMeasures(n) = $LB(name,caption,type)
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)
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.
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).
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).
Given the logical name, pCubeName of a DeepSee cube, return the name of the default Measure. Note: this is no longer used by DeepSee.
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.
Get the cube dependency graph for the given cube: pGraph(cube, dependentCube) = ""
Return the localized display name for a given element within the given cube.
Return the fact name associated with a given element within the given cube.
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.
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" or "all" for dimension, hierarchy, level, measure 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)
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 specifies constraints on the list of members: It takes the form:
pContext = $LB(memberSpec,key)
The list is returned via pMembers. This takes the form:
pMembers(n) = $LB(value,name,memberId,memberKey)
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.
Return the properties of a given level within the given cube as an array of form:
pProperties(n) = $LB(name,caption,type)
Given the dimension,hierarchy, and level number for a dimension within the specified cube, return it's specification string.
Return an array of the dimension tables (class names) used for a given cube. If pCardinality is true, compute the size of each table.
Return the URL for the DeepSee management portal error page.
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.
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]
Given the logical name, pKPI of a DeepSee KPI, return its caption.
Given the logical name, pKPIName of a DeepSee KPI, return the class name of the KPI definition.
Given the logical name, pKPIName of a DeepSee KPI return its class description.
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)
Given the logical name, pKPI of a DeepSee KPI, return the date of the time the KPI definition was modified (in $H format).
Given the logical name, pKPIName of a DeepSee KPI, return its name in its original case.
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) = ""
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.
Return the localized display name for a given element within the given cube given a dimension, hierarchy, and level name.
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.
Return a list of all currently defined Ensemble Business Metrics visible to the current user. This is used by utilities.
This list takes the form:
pList(NAME) = $LB(name,caption,moddate,type)
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.
This method does not work on SubjectAreas; use %GetSubjectAreaModel.
Return details on the given named filter in the array pInfo.
Return all named filters for a given cube as an array of form:
pFilters(n) = $LB(name,tooltip,spec,cube)
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.
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.
Returns the SQL name of property pProp for class pClass.
Returns the SQL table name for class pClass.
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.
Builds a list of available time level classes. The list is of the form list(NAME) = class. [Previously private]
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.
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.
Test if the given cube is available for querying.
Given the logical name, pCubeName of a DeepSee cube, test if it is a compound cube (composed of two or more cubes joined together).
Given the logical name, pKPIName of a DeepSee KPI, test if it is public.
Return whether the given year is a leap year.
Given the logical name, pCubeName of a DeepSee cube, and the name of a dimension, test if the dimension is a relationship.
Delete all indices and cache values for the given cube.
Delete any KPI cache values for the given cube.
Compute pre-loaded cell cache entries for the given cube based on the cell cache specification within the cube's definition.
Test if a given element within the given cube has child levels.
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).
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.
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.
%PurgeDSTIME purges all nodes in ^OBJ.DSTIME that have already been processed by all cubes. This method checks the DSTIME value for each cube 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.
If the DSTIME index is used for any purpose other than DeepSee then the user should not use this method to purge the DSTIME index.
Parameters pVerbose Input If true then status messages will be displayed on the current device. pPurged Output An array of DSTIME entries that have been purged. For example: purged("DeepSee.Study.CityRainfall")=1 purged("DeepSee.Study.Patient")=2 purged("HoleFoods.Transaction")=0The 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.
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.
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.
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 agent starts.
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.
Save a named filter.
Set the default number of background processes used by DeepSee.
DeepSee actually creates double the specified number of processes: one set is used for high priority work, and the other set is used for low priority work.
If set to "", then 4 times the number of cores is used.
Return the current default agent count (which could be "").
This will only take effect after DeepSee is reset.
Update the sync timestamp for the given cube.
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.
Invoke the DeepSee command line shell.
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.
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.
Unformat a date value according to the given format and convert to $H (or "").
See%FormatDate for information on formats.
Programmatic API for updating the value of a dimension property after a cube has been built.It takes the following arguments:Set tSC = ##class(%DeepSee.Utils).%UpdateDimensionProperty( "Holefoods","[Outlet].[H1].[Region].&[Asia]","Asia2")
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.
Write the cube dependency graph for the given cube.