New Journal creation
In TGKML scripts that produce Journals (run on journal cubes RETT and RETT_C), the system checks if all the required Journal Headers exist on the Scenario/Period being processed.
It is possible to create new Journal Headers to contain the resulting Journals based on other existing Headers that have the same Journal Number field.
There are two functions that allow doing so: NewRett() and OpenAdj().
Both functions can only be used in the output expression of an assignment.
NewRett¶
Its syntax is:
NewRett(
where
Assume having the following assignment:
[RETT].[OUT](NewRett(Time.Scenario.Prev.Last)) := [IN1]+[IN2];
the system checks if all the Journals that are returned as result of the input expression have a corresponding Journal Header in the Scenario/Period being processed. If the Header does not exist, the system will create a new one with the following fields:
- Scenario and Period - same as the ones being processed.
- Journal Number - same as the one resulting from the input expression.
- All the other fields - same as the Header with the following specifics:
- Scenario and Period obtained by applying
- Journal Number resulting from the input expression of the assignment
If no Journal Header with the same Number exists for the Scenario/Period obtained by the Time Jump, data will be inconsistent.
In case the cube used in the assignment is RETT_C the new Header will have the following fields:
- Scenario - same as the Original Scenario of the Consolidation one being processed.
- Period - same as the one being processed.
- Journal Number - same as the one resulting from the input expression.
- All the other fields - same as the Header with the following specifics:
- Scenario and Period obtained by applying
- Journal Number resulting from the input expression of the assignment.
OpenAdj¶
In this case no time jump is performed. The system will check all input records and retrieve the Journal Headers for all input Scenario/Period combinations.
Assume having the following assignment:
[RETT].[OUT](OpenAdj) := [IN1](Time.Scenario.Prev.Last)+[IN2];
the system checks if all the Journals that are returned as result of the input expression have a corresponding Journal Header in the Scenario/Period being processed. If the Header does not exist, the system will create a new one with the following fields:
- Scenario and Period - same as the ones being processed.
- Journal Number - same as the one resulting from the input expression.
- All the other fields - the system searches all Headers having the above Journal Number for the Scenario/Periods of the Input records (in this case Current Scenario/All Periods and Previous Scenario/Last Period) and acts as follows:
- If the Journal Number is present on exactly one Scenario/Period, the system will use the fields of the corresponding Journal Header;
- If the Journal Number is present on more than one Scenario/Period, the system checks if the corresponding Journal Headers are identical. If all fields match, they will be used for the new Header being created, otherwise, the system signals an error.
- If there is no match, the system signals an error.