ViewCreate

ViewCreate creates an empty view of a specified cube.

When the optional AsTemporary argument is set to 1, the view is temporary and persists only for the duration of the TurboIntegrator process or chore in which the view is created.

Note:

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

For TM1 Server version 11.3.0 and later, these temporary views 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 view S, the temporary view S exists for the duration of the parent TurboIntegrator process A. You cannot create a temporary view with the same name S in the sibling TurboIntegrator process A2 since the view is visible and usable by siblings A1 and A2.

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

Temporary objects have transaction scope. When a transaction is committed, all temporary objects are cleaned up. If a chore is run in single-commit mode where all processes in the chore are logically run within the context of one transaction, then temporary objects that are created in a process still exist, visible, and available for use, in subsequent processes run by the chore. However, in multi-commit mode, these processes are cleaned up at commit time of the transaction that wrapped the execution of the process that created the temporary object.

There is no locking associated with a temporary view, as a temporary view 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 view.

This function is valid in TM1 TurboIntegrator processes only.

Syntax

ViewCreate(Cube, ViewName, <AsTemporary>);

Argument

Description

Cube

The parent cube of the view you are creating.

ViewName

The name you want to assign to the view.

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.

Example

This example creates a temporary view named 1st Quarter Actuals from the Sales cube.

ViewCreate('Sales', '1st Quarter Actuals', 1);