@XWRITE

The @XWRITE calculation function enables a database calculation to write values to another Essbase cube, or to the same cube.

The following terminology is used to describe the @XWRITE function:

  • Source cube: the cube on which the current calculation is running (that is, the cube on which the @XWRITE call originates).

  • Target cube: the cube that is updated by @XWRITE. This cube may be remote (that is, on a different machine than the source cube).

  • Point of view: the member combination currently being calculated on the source cube.

This function writes to data blocks, either in the same cube or in a remote cube, while calculating a block in the current cube. @XWRITE does not impose member and dimension mapping restrictions, which means that the data source and data target outlines can be different.

As arguments, this function takes a location alias, an implied list of members that represents the current point of view, and an optional list of members to qualify @XWRITE on the target. The second argument (the members making up the current point of view) is implied; that is, these members are not specified as an @XWRITE parameter. An @XWRITE that omits the third argument indicates that a given data point in the source will be set to the same data point in the target.

Syntax

There are multiple ways to call this function, depending on your goal.

Syntax 1

To incorporate values from a remote cube, use:

@XWRITE (expression, locationAlias [, mbrList])

For Syntax 1 using location alias, a querying user does not need to be provisioned nor signed in on the remote cube.

Syntax 2

To incorporate values from another application and cube on the same Essbase server instance, use:

@XWRITE (expression, appname, dbname [, mbrList])

For Syntax 2, a querying user must be signed in on the target cube, and also provisioned on the source cube.

Parameters

expression

A single member specification, variable name, or other numeric expression corresponding to the value to be stored.

locationAlias

A location alias for the data target. A location alias is not needed if the source and target are on the same Essbase server instance.

If used, the location alias must be set on the cube on which the calculation script will be run. The location alias is set by the administrator and specifies a server, application, cube, username, and password for the target cube.

The same location alias can be used by both @XREF and @XWRITE. For @XREF, it represents the data source, and for @XWRITE it represents the target cube.

For @XWRITE only, a reserved keyword @LOOPBACK can be used to write to the same cube.

mbrList

Optional. A comma-delimited list of member names that qualify the @XWRITE operation. The members you specify for mbrList, in addition to the members in the current point of view in the source cube, determine what is written to the target cube. The target cube is written to using the following calculation logic (in order of precedence):

  1. The members specified in mbrList

  2. The members in the current point of view

  3. The top member in any unspecified dimensions in the target cube

Therefore, the remote member list is calculated and written using members from current point of view, overridden with members from the mbrList specified to @XWRITE, and if some dimensions are still absent at the target cube, the top most dimension of the target cube is used.

See Notes for more information about the mbrList parameter.

appname, dbname
Application and cube name. Use only for deployments with only one Essbase server instance.

Notes

  • This function is applicable only to block storage cubes.

  • An error is returned if the members supplied in mbrList do not exist in the target cube.

  • The member list cannot contain functions that return more than one member. For example @LEVMBRS(Market,0).

  • The member list cannot contain ranges.

  • The member list cannot contain attribute members or attribute operators.

  • @XWRITE is a top-down formula. For more information on top-down formulas, see Bottom-Up and Top-Down Calculation.

  • @XWRITE to dynamic calc cells is not recommended; the data is calculated in memory, but not written.

  • @XWRITE can be used in calculation scripts as well as outline member formulas.

Example

The following Sample Basic formula writes the 100-30 values into 100-20 on the same cube:


FIX (East, Actual, Budget, Sales)
"100-30" (
@XWRITE("100-30", @loopback, "100-20");
)
ENDFIX

The following Sample Basic formula writes the 100-30 values into 100-20 on a remote cube, Sample2 Basic, using the location alias "sam2basic" defined from Sample Basic to Sample2 Basic:


FIX (East, Actual, Budget, Sales)
"100-30" (
@XWRITE("100-30", sam2basic, "100-20");
)
ENDFIX

The following example shows how to call another function within the @XWRITE function call:


FIX (East, Actual, Budget, Sales)
"100" (
 @XWRITE(@PARENT("100-30"), @loopback, "100-20");
 )
ENDFIX