AnalyticModel Class Methods
In this section, we discuss the AnalyticModel methods. The methods are discussed in alphabetical order.
Syntax
AddMember(DimName, MemberName)
Description
Use the AddMember method to add the specified dimension member to the specified dimension.
Parameters
Field or Control |
Definition |
---|---|
DimName |
Specify the dimension to which you want to add the member. |
MemberName |
Specify the name of the member that you want to add to the specified dimension. |
Returns
None.
Syntax
AttachTree(DimName, TreeName, setID, UserKeyValue, EffDt, NodeName, OverrideRecord, DetailStartLvl, TreeDiscardLvl)
Description
Use the AttachTree method to attach a tree to a dimension. Only one tree can be attached to a dimension at a time. You can only attach a tree before the analytic instance is loaded.
Parameters
Field or Control |
Definition |
---|---|
DimName |
Specify the name of the dimension that you want to attach a tree to. |
TreeName |
Specify the name of the tree that you want to attach to the dimension. |
setID |
Specify the table indirection key for the tree. This parameter takes a string value. If the tree structure the tree is based on has its IndirectionMethod specified as "S", you must specify a setID. If the tree structure doesn’t have its IndirectionMethod specified as "S", you must enter a Null string (that is, two quotation marks with no blank space between them ("")) for this parameter. |
UserKeyValue |
Specify the User Key Value for the tree. This parameter takes a string value. If the tree structure the tree is based on has its IndirectionMethod specified as "U" or "B", you must specify a User Key Value. If the tree structure doesn’t have its IndirectionMethod specified as "U" or "B", you must enter a Null string (that is, two quotation marks with no blank space between them ("")) for this parameter |
EffDt |
Specify an effective date for this tree. This parameter takes a string value. |
NodeName |
Specify the tree node used as the dimension hierarchy root. This can be different from the tree root, that is, you can pick a subtree. |
OverrideRecord |
Specify the name of a record to be used for overriding the aggregate. |
DetailStartLvl |
Specify the tree level number (such as 1 for the node hierarchy root specified by the NodeName parameter) at which detail nodes start. If you specify a value other than 0, any nodes at this level or greater than this level are considered details node, and any nodes with levels less than the start level are considered aggregate nodes If you specify 0, detail nodes are nodes that don't have parents (a node can be a parent either by having children or by having child ranges). |
TreeDiscardLvl |
Specify the tree level number (such as 1 for the node hierarchy root specified by the NodeName parameter) at which to stop loading the tree. Nodes at this level or at levels greater are discarded. This parameter is only used if it has a value other than 0, and if it has a value greater than DetailStartLvl. |
Returns
None.
Syntax
CalculateCube(CubeName[, Sync])
Description
Use the CalculateCube method to calculate the named cube in synchronous mode.
Parameters
Field or Control |
Definition |
---|---|
CubeName |
Specify the name of the cube that you want to calculate. |
Sync |
This parameter is optional and is not used. It is only being included for previous releases. This parameter takes a Boolean value. The value of this parameter is ignored. The cube is always calculated in synchronous mode. |
Returns
None.
Syntax
DetachTree(DimName)
Description
Use the DetachTree method to detach a tree from the specified dimension.
You can only attach a tree when the analytic instance is not loaded. This method fails if you try to detach a tree while the analytic instance is loaded.
Parameters
Field or Control |
Definition |
---|---|
DimName |
Specify the name of the dimension from which you want to detach a tree. |
Returns
None.
Syntax
GetCubeCollection(CubeCollName)
Description
Use the GetCubeCollection method to return a reference to a CubeCollection object.
Parameters
Field or Control |
Definition |
---|---|
CubeCollName |
Specify the name of the cube collection to which you want a reference. |
Returns
A CubeCollection object if successful.
Syntax
GetCellProperties(CubeName, &Node)
Description
Use the GetCellProperties method to get information about a cell.
Parameters
Field or Control |
Definition |
---|---|
CubeName |
Specify the name of the cube that contains the cell you want information about. |
&Node |
Specify an already instantiated array of array of string (a two-dimensional array of string) containing name-value pairs of the node name and the node detail. |
Returns
An array of string.
The four strings returned in the array are:
Cell type. Values are “Aggregate” or “Detail”
User function.
Dimension for aggregation, the dimension name.
Aggregation reason. Values are: “Dimension Level Override”, “Member Level Override”, “Cube Dimension Level Override”, “None.”
Syntax
GetMembers(DimName, DimFilter)
Description
Use the GetMembers method to return the names of the members in the specified dimension. You can specify a user function to be used as a filter for the dimension using DimFilter.
When filtering hierarchy nodes, if the parent member is filtered, all the child nodes are also filtered.
In order to filter the parent member if all of its children are filtered, the user function should be written such that for the parent node, apply the condition on all of its children, using the FORCHILDREN built-in function. If none of the children satisfy the condition, return zero from the user function, which filters the parent node.
Parameters
Field or Control |
Definition |
---|---|
DimName |
Specify the name of the dimension from which you want to get the members. |
DimFilter |
Specify a user function that you want to use to filter the dimension. |
Returns
A two-dimensional array of any.
The first dimension contains the member names. The second dimension contains the parent of the member. The members are sorted in the hierarchy order.
If the dimension does not have a hierarchy, all members are returned as level one.
For example, if the dimension has the following members:
ALLREGIONS
NORTH AMERICA
USA
CANADA
MEXICO
EUROPE
FRANCE
GERMANY
ENGLAND
ASIA
JAPAN
CHINA
The GetMembers method returns the following:
Member Name |
Level |
---|---|
ALLREGIONS |
Null |
NORTHAMERICA |
ALLREGIONS |
USA |
NORTHAMERICA |
CANADA |
NORTHAMERICA |
MEXICO |
NORTHAMERICA |
EUROPE |
ALLREGIONS |
FRANCE |
EUROPE |
ENGLAND |
EUROPE |
GERMANY |
EUROPE |
ASIA |
ALLREGIONS |
JAPAN |
ASIA |
CHINA |
ASIA |
If the total member is present in the metadata, it is returned as level zero.
Syntax
GetTree(DimName)
Description
Use the GetTree method to return an array of string that contains information about the tree that is attached to the specified dimension.
Parameters
Field or Control |
Definition |
---|---|
DimName |
Specify the name of the dimension to which a tree is attached. |
Returns
An array of string.
The array items have the following format:
TreeName
setID
UserKeyValue
EffDt
BranchName
Override record name
DetailStartLvl
TreeDiscardLvl
Syntax
Recalculate(Sync)
Description
Use the Recalculate method to recalculates the loaded analytic model. If Sync is true, the transaction is synchronous, else it is performed asynchronously.
The Recalculate method always writes any changes to readable, readable and writable, as well as writable records to the database as specified by the analytic type definition.
If you are running in asynchronous mode, this method returns an optional string that contains the operation ID to be used with the CheckAsyncStatus property.
Parameters
Field or Control |
Definition |
---|---|
Sync |
Specify whether the recalculation should be run synchronously or asynchronously. This parameter takes a Boolean value: true if it should be run synchronously, false otherwise. |
Returns
A string.
Syntax
RenameMember(DimName, OrigMemberName, NewMemberName)
Description
Use the RenameMember method to rename a member in the specified dimension.
Parameters
Field or Control |
Definition |
---|---|
DimName |
Specify the dimension that contains the member you want to rename. |
OrigMemberName |
Specify the name of the member that you want to rename. |
NewMemberName |
Specify the new name for the member specified by OrigMemberName. |
Returns
None.