SubsetCreate

SubsetCreate creates an empty public subset of a specified dimension.

When the AsTemporary argument is set to 1, the subset is temporary and persists only for the duration of the TurboIntegrator process or a single-commit chore in which the subset is created. If a parent TurboIntegrator process invokes child TurboIntegrator processes by using the ExecuteProcess or ExecuteProcessWithReturn function, and the temporary subset is created in one of these child TurboIntegrator processes, the subset persists for the duration of the parent TurboIntegrator process.

This function is valid in TM1® TurboIntegrator processes only.

Note:

For TM1 Server version 11.2.0 and earlier, temporary views and subsets were visible and usable only by the process that created it and any of its child processes. Temporary views and subsets were not visible to the ancestor and sibling processes. You could create same-named subsets in sibling child processes with the same parent process.

For TM1 Server version 11.3.0 and later, these temporary subsets are visible to the ancestor and sibling processes. If a parent TurboIntegrator process A invokes two child TurboIntegrator processes A1 and A2, and the child TurboIntegrator process A1 creates a temporary subset S, the temporary subset S exists for the duration of the parent TurboIntegrator process A. You cannot create a temporary subset with the same name S in the sibling TurboIntegrator process A2 since the subset is visible and usable by siblings A1 and A2.

A chore is a special case of a parent TurboIntegrator process that invokes a child TurboIntegrator process that is scheduled to run at a specific time. You can use two types of chores.

Single-commit
Within the scope / execution tree of a single-commit chore, a temporary subset of the same name can be created only for one child TurboIntegrator process.
Multi-commit
Within the scope / execution tree of a multi-commit chore, which commits after every child TurboIntegrator process, every child TurboIntegrator process can create a temporary subset of the same name because a temporary subset will not persist after a commit.

While a temporary subset exists, the temporary subset takes precedence over any same-named public or private subset. If another TurboIntegrator function references a subset that exists in both a temporary and permanent state, the function operates upon the temporary subset.

There is no locking associated with a temporary subset because a temporary subset is never saved. This can result in improved performance because there is no need for TurboIntegrator to wait for locks to be released before operating upon a temporary subset.

Syntax

SubsetCreate(DimName, SubName, [AsTemporary]);

Argument

Description

DimName The parent dimension of the subset you are creating.
SubName The name that you want to assign to the subset.
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.

Example

SubsetCreate('Region', 'Northern Europe', 1);

This example creates the temporary Northern Europe subset of the Region dimension. You can use SubsetElementInsert to add elements to the subset.