TM1 - Turbo Integrator Fuctions
TM1 - Turbo Integrator Fuctions
o break
o else
o elseif
o end
o endif
o if
o while
Dimension Manipulation
1. DimensionCreate:
Syntax: DimensionCreate(DimName);
Exp: DimensionCreate(’Product’);
2. DimensionDestroy
Syntax: DimensionDestroy(DimName);
Exp: DimensionDestroy(’Product’);
3. DimensionDeleteAllElements
Deletes all the elements in a dimension and is useful for recreating dimension hierarchies.
4. DimensionElementInsert
Adds the element 'Newspaper' into 'Products' dimension just before the element 'Book' of type numeric
This will add the new element 'Halogen Light' of type numeric to the end of the list.
5. DimensionElementInsertDirect
Direct edits are different in that no editing copy is involved. Instead, the operations are performed directly on the
actual dimension. There are two different, specialized use cases for which this type of direct editing is intended:
> When the purpose of the TurboIntegrator process is to make a small change to a large dimension. In this case,
direct editing will be more efficient because it avoids copying and completely rewriting the large dimension.
> When the purpose of the TurboIntegrator process is to load large volumes of data into a cube. In this case the
process' Metadata procedure is deliberately kept empty, and any element insertion needed to support data loading is
performed using direct calls in the Data procedure. When the Metadata procedure is empty, the process skips an
entire iteration over the external datasource, which can result in faster data loads.
6. DimensionElementDelete
7. DimensionElementDeleteDirect
8. DimensionElementComponentAdd
9. DimensionElementComponentAddDirect
11. DimensionElementComponentDeleteDirect
Deletes a component (child) from a consolidated element by directly editing the dimension.
12. DimensionTopElementInsert
Creates a root element in a dimension. If the dimension already has a single root, then this element will
not be created.
13. DimensionTopElementInsertDirect
Creates a root element in a dimension by directly editing the dimension. If the dimension already has a
single root, then this element will not be created.
14. DimensionSortOrder
Sets a sort type and sense for dimension elements and for components of consolidated elements within
a dimension.
15. DimensionUpdateDirect
Syntax: DimensionUpdateDirect(DimName);
Exp: DimensionUpdateDirect(’Product’);
Performs a full rewrite of a dimension that has been subject to direct editing in a TurboIntegrator
process, essentially compacting the memory footprint of the dimension.
16. DimensionElementPrincipalName
17. DimensionExists
Syntax: DimensionExists(DimName);
Exp: DimensionExists(’Product’);
Determines if a specific dimension exists on the server from which a TurboIntegrator process is
executed. The function returns 1 if the dimension exists on the server, otherwise it returns 0.
18. DimensionHierarchyCreate
HierName = The name that you want to assign to the hierarchy. You cannot use the name of the
dimension.
19. DimensionTimeLastUpdated
Syntax: DimensionTimeLastUpdated(DimName);
Exp: DimensionTimeLastUpdated('Product');
Creates a cube from specified dimensions. The order of dimensions specified in the function will be the
order of dimensions in the cube definition.
2. CubeDestroy
Syntax: CubeDestroy(Cube);
Exp: CubeDestroy('Product');
3. CubeClearData
Syntax: CubeClearData(Cube);
Exp: CubeClearData('Product');
This function is much faster than doing an operation such as creating a view to cover the entire
cube, and then doing a ViewZeroOut() to zero out the entire cube.
In CubeClearData to clear data from a cube, any cells in the cube that are fed with feeders are
also cleared. You must resave the rule that establishes the feeders or use the CubeProcessFeeders
function to restore the fed cells.
This call just deletes the cube data, it does not delete and re-create the cube itself. This has implications when
sandboxes are used. If a cube is deleted and then re-created any sandboxes a user may have will be discarded, since
the cube against which those sandboxes were created was deleted (even though a cube may have been re-created
with the same name). If however the CubeClearData() call is used, the sandbox data will still be considered valid,
since the cube against which the sandbox was created continues to exist.
4. CubeUnload
Syntax: CubeUnload(CubeName);
Exp: CubeUnload(’Product’);
Unloads a specified cube, along with all associated cube views, from memory. It only disconnects cube
from memory.
5. AddCubeDependency
Exp: Consider a cube named 'SalesCube' that includes the rule ['net']=!Units * DB('PriceCube', ... );
In this example, 'SalesCube' is the dependent cube, as it is dependent on values in the base cube named
'PriceCube' to calculate the value of 'net'. To establish this dependency, you should run the following
function in a TurboIntegrator process: AddCubeDependency( 'PriceCube', 'SalesCube' );
AddCubeDependency lets you predefine cube inter-dependencies to avoid lock contention problems
during normal system use.
In normal operations, cube dependencies are established when data which crosses cube boundaries
(such as data that is derived by a rule that references an external cube) is retrieved. To create the
dependency information, the server must lock the cubes while the dependency is established,
potentially maintaining the lock during a long view calculation. Since this is a 'write' lock, other users are
prevented from accessing the cubes. The AddCubeDependency function allows the dependency to be
established when the server starts up, preventing later lock contention as no new dependency need be
established.
6. CubeExists
Syntax: CubeExists(CubeName);
Exp: CubeExists(’Product’);
Determines whether a specific cube exists on the server from which a TurboIntegrator process is
executed. The function returns 1 if the cube exists on the server, otherwise it returns 0.
7. CellGetN
Exp: CellGetN('Products2', 'Admin', 'HP machine1', 'Revenue', 'Salary', 'Apr', 'Actual', 'Budget Version2');
8. CellPutN
Exp: CellPutN(24, 'Products2', 'Admin', 'HP machine1', 'Revenue', 'Salary', 'Apr', 'Forecast', 'Budget
Version2');
Exp: CellGetS('Products2', 'Admin', 'HP machine1', 'Revenue', 'Salary', 'Apr', 'Actual', 'Budget Version2');
10. CellPutS
Exp: CellPutS(478, 'Products2', 'Admin', 'HP machine1', 'Revenue', 'Salary', 'Apr', 'Forecast', 'Budget
Version2');
11. CellIncrementN
Exp: CellIncrementN(24, 'Products2', 'Admin', 'HP machine1', 'Revenue', 'Salary', 'Apr', 'Forecast',
'Budget Version2');
12. CellPutProportionalSpread
Distributes a specified value to the leaves of a consolidation proportional to existing cell values.
CellPutProportionalSpread replaces existing cell values; it cannot be used to add to or subtract from
existing cell values.
When using CellPutProportionalSpread to distribute a value to the leaves of a consolidation, only those
leaves already containing non-zero values are changed. This is because zero values cannot be
incremented or decremented proportionally; any proportion of zero is still zero.
13. CellIsUpdateable
Exp: CellIsUpdateable('Products2', 'Admin', 'HP machine1', 'Revenue', 'Salary', 'Q1', 'Actual', 'Budget
Version2'
Lets you determine if a cube cell can be written to. The function returns 1 if the cell can be written to,
otherwise it returns 0.
14. CubeSetLogChanges
LogChanges The Boolean value you want to assign to the property. 1= LOGGING on, 0 =
LOGGING off.
Exp: CubeSetLogChanges(’Products2’, 0 );
15. CubeGetLogChanges
Syntax: CubeGetLogChanges(CubeName);
Exp: CubeGetLogChanges(’Products2’);
Returns the Boolean value of the Logging property for a specified cube. If Logging is turned on for a
cube, the function returns 1. If logging is turned off the function returns 0.
16. CubeDimensionCountGet
Syntax: CubeDimensionCountGet(CubeName);
Exp: CubeDimensionCountGet('Products2');
17. CubeSaveData
Syntax: CubeSaveData(Cube);
Exp: CubeSaveData('Products2');
Serializes a cube.
SaveDataAll has been used to serialize data to disk and to truncate the transaction log. When processing
a SaveDataAll command, the server acquires a READ lock on every cube and an IX lock on every changed
cube. This can cause significant contention with user activity if SaveDataAll is run during periods of user
activity.
18. CubeSetConnParams
Used to encrypt the password for a virtual cube in the }CubeProperties cube.
19. CubeTimeLastUpdated(cube);
Syntax: CubeTimeLastUpdated(CubeName)
Exp: CubeTimeLastUpdated('Products2');
Returns a serial value that indicates the date and time at which a specified cube was last updated.
1. SubsetCreate
2. SubsetCreateByMDX
<AsTemporary> - This is an optional argument that specifies whether the subset that is being created is
temporary. 1 indicates a temporary subset. 0 indicates a permanent subset.
If this argument is omitted, the subset is permanent.
3. SubsetDeleteAllElements
4. SubsetDestroy
5. SubsetElementInsert
6. SubsetElementDelete
7. SubsetExists
Use to determine if a specific public subset exists on the server from which a TurboIntegrator process is
executed. The function returns 1 if the subset exists on the server, otherwise it returns 0. Note that this
function cannot be used to determine the existence of private subsets.
8. SubsetAliasSet
Sets the alias attribute to be used in a subset. SubsetAliasSet returns 1 if successful, 0 otherwise. If there
is Alias for the dimension (even in case the Alias column has no values for the elements) then it will
return 1. If there is no Alias column, then error will come and outcome result is 0.
9. SubsetGetElementName
Returns the name of the element at a specified index location within a given subset.
10. SubsetGetSize
11. SubsetExpandAboveSet
Set ExpandAboveFlag to 1 to set the Expand Above property to TRUE. When this property is TRUE,
consolidations expand above on rows and to the left on columns.
Set ExpandAboveFlag to 0 to set the Expand Above property to FALSE. When this property is FALSE,
consolidations expand below on rows and to the right on columns.
Sets the Expand Above property for a subset. When this property is set to TRUE, children of a
consolidation are displayed above the consolidation when the consolidation displays on a row, and to
the left of the consolidation when the consolidation displays on a column. The function returns 1 if
successful, otherwise it returns 0.
12. SubsetFormatStyleSet
13. SubsetIsAllSet
Sets a subset to use all elements of the parent dimension. It is equivalent to clicking the All button on
the Subset Editor. SubsetIsAllSet returns 1 if successful, 0 otherwise.
14. SubsetMDXGet
Optionally, the MDX expression that you want to populate the subset with. All elements are deleted and
the subset is populated with the elements as defined by the new MDX expression. If the MDX expression
is invalid, TurboIntegrator processing stops, the contents of the subset is unchanged and an error is
logged. If you do not use this parameter, include an empty string as shown in the example.
1. PublishView
Exp:
3. ViewCreate
AsTemporary This is an optional argument that specifies whether the view being created is
temporary. 1 indicates a temporary view, 0 indicates a permanent view.
If this argument is omitted, the view is permanent.
4. ViewDestroy
5. ViewZeroOut
6. ViewExists
7. ViewColumnSuppressZeroesSet
Flag A binary value that enables or suppresses zeroes. Specify 1 to suppress the display of
columns containing only zeroes in the view. Specify 0 to enable the display of columns
containing only zeroes.
Suppresses or enables the display of columns containing only zero values in a TM1 cube view.
8. ViewRowSuppressZeroesSet
Flag A binary value that enables or suppresses zeroes. Specify 1 to suppress the display of rows
containing only zeroes in the view. Specify 0 to enable the display of rows containing only
zeroes.
Exp: ViewRowSuppressZeroesSet ('Products2', 'View1', 1);
Suppresses or enables the display of rows containing only zero values in a TM1 cube view.
9. ViewSuppressZeroesSet
Suppresses or enables the display of all rows and columns containing only zero values in a TM1 cube
view.
10. ViewExtractSkipCalcsSet
Sets an option to include/exclude consolidated values in a view extract. A view extract is a TM1 view
exported as an ASCII comma-delimited (.cma) file. ViewExtractSkipCalcsSet is the equivalent of the Skip
Consolidated Values option in the View Extract dialog box.
Exp:
11. ViewExtractSkipRuleValuesSet
ViewExtractSkipRuleValuesSet is the equivalent of the Skip Rule Calculated Values option in the View
Extract dialog box.
12. ViewExtractSkipZeroesSet
ViewExtractSkipZeroesSet is the equivalent of the Skip Zero/Blank Values option in the View Extract
dialog box.
13. ViewExtractSkipConsolidatedStringsSet
Exp:
sets an option to exclude strings on consolidated values that are excluded from a view or any associated
view extracts. A view extract is a TM1® view exported as an ASCII comma-delimited (.cma) file.
TM1 allows the storing of strings on calculated values. When you exclude a calculated value from a view
or view extract you may want to exclude the message string also from the view.
14. ViewSubsetAssign
15. ViewColumnDimensionSet
StackPosition A number that indicates the stack position of the dimension in the view. This is a
1-based number. 1 indicates the top-most stack position. 2 indicates a position
below 1, and so on.
16. ViewRowDimensionSet
17. ViewTitleDimensionSet
Exp:
18. ViewTitleElementSet
Exp:
Sets a title element for a TM1 view. ViewTitleElementSet is used in conjunction with the
ViewTitleDimensionSet function.
Planning Analytics:
19. ViewCreateByMDX
20. ViewMDXGet
21. ViewMDXSet
Syntax: DisableMTQViewConstruct();
23. EableMTQViewConstruct
Syntax: EableMTQViewConstruct();
The value of MTQQuery can be overridden on a single TurboIntegrator process by calling the
EnableMTQViewConstruct function.
If MTQQuery=F in the tms1.cfg file on the server where this function is run, EnableMTQViewConstruct
can be called to override this value on a single TurboIntegrator process.
You can enable EnableMTQViewConstruct in either the Prolog or Epilog section of a TurboIntegrator
process. For efficiency, enable EnableMTQViewConstruct in the first, or very close to the first, statement
in the Prolog section of your process.
1. ATTRNL
2. ATTRSL
4. AttrInsert
PrevAttr The attribute that precedes the attribute you are creating.
AttrName The name you want to assign to the new attribute.
Type The type of attribute. There are three possible values for the Type argument:
N - Creates a numeric attribute.
S - Creates a string attribute.
A - Creates an alias attribute.
Creates a new element attribute for a dimension. The function can create a string, numeric, or alias
attribute.
5. AttrPutN
6. AttrPutS
7. CubeAttrDelete
Syntax: CubeAttrDelete(AttrName);
9. CubeAttrPutN
CubeName The cube for which you want to assign an attribute value.
AttrName The attribute whose value you want to assign.
LangLocaleCode This optional parameter specifies the language locale code to which the
NumericValue applies.
Valid LangLocaleCode values correspond to the ISO 639-1 international
language codes listed in the }Cultures control dimension.
When the LangLocaleCode is not specified or is omitted, the base attribute
value is updated.
10. CubeAttrPutS
11. CubeAttrN
AttrName: The attribute for which you want to retrieve a value. This argument must be a valid attribute
of the cube.
Returns a numeric attribute for a specified cube.
12. CubeAttrS
13. CubeAttrNL
Returns a numeric attribute value for a specified cube with respect to a given locale.
14. CubeAttrNL
Returns a string attribute value for a specified cube with respect to a given locale.
15. DimensionAttrDelete
Syntax: DimensionAttrDelete(AttrName);
16. DimensionAttrInsert
17. DimensionAttrPutN
18. DimensionAttrPutS
19. DimensionAttrN
20. DimensionAttrS
21. DimensionAttrNL
Returns a numeric attribute value for a specified dimension with respect to a given locale.
22. DimensionAttrNL
Returns a string attribute value for a specified dimension with respect to a given locale.
1. ASCIIDelete
Syntax: ASCIIDelete(FileName);
2. ASCIIOutput
3.
TI Local Variables
DATASOURCECUBEVIEW = 'ViewName';