Modifying a Dimension – Backend Editor

There are a few ways to update a dimension within TM1, the first is the simplest and most commonly used.

To update a Dimension using the Dimension Editor:
  1. Right Click on the Dimension
  2. Click “Edit Dimension Structure”
 
  1. Right Click any where and click “Insert Element”
 
  1. Type the name of the element
  2. Check the settings are as expected (Element Type)
 
  1. Click ‘Add’ to insert the Element into the Bottom Pane
  2. Click ‘Ok’ to insert the Element into the Dimension Window
  3. Click ‘Ok’ to close the Dimension Editor and save the changes

Turbo Integrator Troubleshooting

Turbo Integrator Overview
Turbo Integrator (TI) Processes are scripts that execute within the TM1 server to perform data manipulation. Most TI Processes use a data source which is processed line by line.
There are 7 major sections to a Process:
  • Data source Settings
  • Data source Variables
  • Parameters
  • Prolog
  • Metadata
  • Data
  • Epilog
Data source Settings
Here you can change the file/query that is being imported. It’s important when sourcing data from a file to have the “Data source Name for Server” being the Path to the source file as known by the server (From the Physical Machine that the server is running on).
Data source Variables
A variable will be added to this tab for every column/field in your data source, these are names for the relative information within each column and will be updated as the process is executed row by row.
Parameters:
These are variables which take a value from the user who is running the process by prompting him/her to fill them when the process is executed.
Prolog:
This is a place for the initial code for the process to run. Code entered here is executed once at the very beginning of the process before the data source file/query is opened/executed.
Metadata:
The code entered here is executed once per line in the data source, each time the process moves to the next line it updates the Data source Variables with the data from the new line and respective column. Primarily for Meta Changes (Dimensions/Elements/Subsets/Cubes/Views)
Data:
The code entered here is executed once per line in the data source, each time the process moves to the next line it updates the Data source Variables with the data from the new line and respective column. Primarily for Data Changes (Sending Data into a cube)
Syntax
TI Code is similar to C++ in that every line of code must be terminated with a semicolon.
The logical operators: for ‘and’ and ‘or’ are ‘&’ and ‘%’ respectively.
The Assignment operator is ‘=’
Arithmetic operators +,-,*, / are all valid.
The Comparative operators are =,>,<,>=,<=,<> for Numeric data .
The Comparative operators are ‘@=’ or ‘@<>’ for Textual data.
Simple Example:
IF( mystring @= ‘Hello World’);
    DOAFUNCTION(parameter1, parameter2, parameterN);
ENDIF;
IF( mynumber >= 2);
    mynumber= mynumber-1;
ENDIF;
Checking for Problems
The best way to check a Process for errors is the Message Log, this can be accessed by right clicking on the server (In Sever Explorer) and selecting “View Message Log…”.
A Process can finish execution in 5 ways:
  • Completely Successfully
  • With Errors
  • Process Aborted
  • With ProcessBreak, ProcessError, ProcessQuit (TI Functions)
  • With Process Canceled (From TM1 Top or User)
By double clicking on the error line you can directly access the Process Log.
Turbo Integrator Error/Abort Cheat Sheet
Error: Invalid key: Dimension Name: “*Dimension*”, Element Name (Key): “*Element*”
Error Level: minor – not all data is loaded
Description: An Element supplied to a ‘CELLPUT’ function does not exist within the relative dimension or the elements have not been supplied in the order of the dimensions within the Cube.
Error: *Tab* procedure line (x): Cell type is consolidated
Error Level: minor – not all data is loaded
Description: Thedata source is providing data at an intersection of elements – one of which elements is a consolidation.An Element supplied to a ‘CELLPUT’ function is a consolidation.
Error: Dimension Update Fail. Rule Is Invalid: Error compiling rule, line number x: Element not found “*Element*”
Error Level: major – no changes were made (all changes were rolled back)
Description: The Process is Deleting/Renaming an element that is used in a Cube rule. Since the Element no longer exists the Rule will not evaluate correctly and will reject the changes.
Error: *Tab* procedure line (x): Unable to register subset
Error Level: major – process will abort
Description: The Process is trying to create a Subset which already exists or the Expression given to a “SUBSETCREATEBYMDX” function has errors
Error: *Tab* procedure line (x): Subset already exist
Error Level: major – process will abort
Description: The Process is trying to create a Subset which already exists.
Error: *Tab* procedure line (x): Consolidated Element “*Element*” not found.
Error Level: minor – Data structure will not be as expected
Description: The Process is trying to add an element as a child of another parent element (using DIMENSIONELEMENTCOMPONENTADD); the parent element does not exist (yet).
Error: *Tab* procedure line (x): View “*viewname*” not found
Error Level: major – process will abort
Description: The Process is trying to modify (ViewExtractSkipCalcsSet etc) or zero out (ViewZeroOut) a view which does not exist.
Error: *Tab* procedure line (x): Component Element “*Element*” not found.
Error Level: minor – Data structure will not be as expected
Description: The Process is trying to add an element as a child of another parent element (using DIMENSIONELEMENTCOMPONENTADD); the child element does not exist (yet).
Error: Cannot convert field number 9, value “*textdata*” to a real number.
Error Level: major – the datasource fields aren’t mapped correctly
Description: A textual field in the data source has been setup as a numeric value within the Process Variables Tab.
Error: Unable to open data source “*datasourcefilename*”.
Error Level: major – the datasource is invalid
Description: The datasource path given is invalid as known by the server.
Error: *Tab* procedure line (x): Attribute dimension “*Dimension*” not found
Error Level: minor – attribute will be blank
Description: The process is trying to retrieve or set an attribute which doesn’t exist per a specific dimension and element.
 
 
Backing out Changes (Where Possible)
Under specific circumstances data changes made to a cube can be ‘Backed out’ via the TM1 Transaction Log. In order for this to be possible the cube must have logging enabled (“}cube_properties” control cube).
To back out data changes:
  1. Right Click on the Server within “Server Explorer”
  2. Select “View Transaction Log”

  1. Select the Date you wish to search from
  2. Select the Cube and/or User (who’s actions you wish to reverse)
  1. Execute the Search
  2. Highlight the items you wish to “back out”
  3. Under “View” click “Select”
  4. Under “View” click “Back out”
 
 
Process in Process
Processes can execute other processes, this is particularly useful for executing a group of processes from a Single Process with given parameters. This saves the user from having to enter in the parameters into each of the child processes.
Syntax:
EXECUTEPROCESS (‘ProcessName’,’NameOfVariable1’,Variable1Value ,… );
Example 1:
ExecuteProcess(‘SYS.Logging Start’);
Using ASCIIOUTPUT/Logging to Debug
When troubleshooting complex Processes that use a lot of nested conditional statements the “ASCIIOUTPUT“ function helps to determine flow of the Program and further more reveal hidden issues. This outputs the data given as parameters 2-20 to the file specified as parameter 1.
Syntax:
ASCIIOUTPUT (filename,item1,item2,itemN);
ASCIIOUTPUT (‘Debug my issue.txt’, VariableImWorriedAbout, OtherVariables…);
Example 1:
Within the Metadata Tab of a Process:
File = ‘debug.txt’;
iRow=iRow+1;
IF(SomeValue = 1);
 IF(SomeOtherValue = 2);
    ASCIIOUTPUT (File, SomeValue, SomeOtherValue, “Did Something”);
 ELSE;
    ASCIIOUTPUT (File, SomeValue, SomeOtherValue, “Did Something Else”);
ENDIF;
ELSE;
    ASCIIOUTPUT (File, SomeValue, SomeOtherValue, “Made it to Else”);
ENDIF;
The file called ‘debug.txt’ can be found in the server’s Data directory which contains the output of the process.

TM1 Security (Pre 9.4)

Overview

Security within TM1 is limited to assigning a client to a group then a group to one or many levels and selections of objects. The levels of objects are:
Tier 1:
  • Cubes
  • Applications
  • Processes
  • Chores
Tier 2 – Dimensions
Tier 3 – Elements
Tier 4 – Cube Cells/Intersections of Elements
The level based security is reciprocated up the tiers meaning in example that if the ‘Final Budget’ Element within the ‘Scenario’ Dimension was switched to ‘Read Only’ for all groups, no data could be written to any cube against the ‘Scenario’ ‘Final Budget’.

Creating a user

Users can be added to the system in three ways:
Use the Security Tools Provided by Right Clicking on the server and selecting ‘Security’ -> ‘Client Groups’
By directly maintaining the ‘}Clients’ control dimension
From within a Turbo Integrator Process

Creating user groups, security assignments etc

Groups can be added to TM1 the same ways as the clients are with the exception that you would maintain the ‘}Groups’ Dimension instead of the ‘}Clients’.
Assigning clients to groups can be done through the same security form ‘Client Groups’ under ‘Security’ when right clicking on the TM1 server in server explorer.
This data is held within the ‘}ClientGroups’ control cube which allows developers to implement rules and processes to derive TM1 Security.
Exercise – Create a few users and assign them to Groups

Cube Level

Cube level security is held in the ‘}CubeSecurity’ Cube. The user interface for these settings can be accessed through right clicking on ‘Cubes’ and selecting ‘Security Assignments’
Application, Processes, Chores and Dimension Security is all managed the same way
Exercise – View the cube security

Element Level

Element level security is slightly different in that the ‘}ElementSecurity_DimensionNameHere’ Cubes are created per dimension when the individual dimensions security assignments are changed.
The security page can be accessed by right clicking on a dimension and selecting ‘Security Assignments’
Exercise – Add some Element Level Security

Public/Private Objects

Some objects (Applications, Subsets and Views) have two states, Public and Private.
Private Objects – Are accessible only to the user that created them, they can be a default View or Subset for a specified cube or a default application to load within TM1 web.
Public Objects – Are defined by administrators and are accessible as ‘Read-Only’ for all users.
Public Objects can be made from private ones via an administrator ‘Publishing’ it.
This can also be managed through a Turbo Integrator Process.

Security Refresh

In most instances a ‘Server Security Refresh’ is needed for the server to apply any security changes.
This is done by right clicking on the server and under the ‘Security’ menu selecting ‘Security Refresh’. In large environments this can take a while.
Exercise – Find and Run a Security Refresh

This is some sample text.

Clear Cube Process

It is good practice to create and destroy a view for clearing rather then leaving a large clear view sitting under the cube waiting for a user to click on it.

The code below creates a view and assigns subsets to that view, zero’s the view out then destroys the view and subsets. Continue reading