Skip to content

Write on an account node/set

The TGKML syntax allows to write the script's result not only on a single account but also on an accounts node or on a set of nodes.

Write on node

The system writes the same result on all the accounts which are related to the specified node. The syntax to use is the following:

[LO].[account hierarchy code|node code] := ...;

For example, we can write [LO].[GG|03] to indicate to write the result on all the accounts which are related to the node 03 of the hierarchy GG.

In this kind of assignments, it is possible to specify as input accounts the same output accounts (typically read from another part of the cube). This is the syntax:

[LO].[GG|03] := [ ](Time.ParallelPeriod(Time.Scenario.Prev));

Please, note that there is a space between square brackets.

It is possible to combine these operands with normal operands (single input accounts). I this case the amounts read from single input accounts are combined with all the output accounts. For example:

[LO].[GG|03] := [20132] * [ ](Time.ParallelPeriod(Time.Scenario.Prev));

Write on a set of accounts

It is possible to define a set of accounts (for further details see SET expression) and then write the result on them only.

For example, we can define the following set of accounts:

Account.@tmp := ([account_1] + [account_2] + [account_3]);

to use in the script syntax as follows:

[LO].@tmp :=...;

MULTI function

It is possible to have a result similar to the previous ones using the Multi function:

[LO].Multi([account_1] + [account_2] + [account_3] +..., Dimension.Filter([]), Dest#.[...],...,...) := ...;

For example we might have

[LO].Multi([X00000] + [C00000], Dest1[D11], Entity.Filter([01|$])) := [D00000] *[P00000];

In this case the product's result is written on each account that belongs to the set defined by the Multi syntax.

The Multi syntax can be used in the input part of the script as well. In this case the system calculates the sum of the accounts that belong to the set defined by the Multi syntax.

Examples:

[LO].@TMP1 := Multi([C00000] + [D00000] + [H00000], Per, Dest1[D11]);

[LO].@TMP2 := Multi([E00000] + [F00000], Per);

[LO].[X00000] := Bound(@TMP2, "P", @TMP1 - @TMP2);

Even if the Multi function and the Set function are similar to each other, the first one is more efficient since the system processes it one time only and not, like for the Set function, every time it is called .