@XWRITE

Enables a database calculation to write values to another Essbase database, or to the same database.

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

The @XWRITE function writes to data blocks, either in the same database or in a remote database, while calculating a block in the current database. @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 data 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 data source will be set to the same data point in the data target.

Syntax

@XWRITE (expression, locationAlias [, mbrList])
ParameterDescription

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. The location alias must be set on the database on which the calculation script will be run. The location alias is set by the database administrator and specifies a server, application, database, username, and password for the data target.

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 data target.

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

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 data source, determine what is written to the data target. The data target is written to using the following calculation logic (in order of precedence):

  • The members specified in mbrList

  • The members in the current point of view

  • The top member in any unspecified dimensions in the data target

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 data target, the top most dimension of the data target is used.

See Notes for more information about the mbrList parameter.

Notes

Example

The following Sample Basic formula writes the 100-30 values into 100-20 on the same database.

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 database, 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

See Also

  • @XREF