This function allows you to create files containing instructions for performing calculations with special requirements on Planning and Consolidation data.
Logic Library
The Admin Console provides a tree node called Logic Library that contains standard logic functions. You can create, modify, and delete files in the logic library. When you open a file in the Logic Library, it opens in edit mode, and there are additional commands available.
The following files are delivered with the sample application set:
Logic files for the Planning and Rate application (located in \WebFolders\<AppSet>\AdminApp\<Application>\):
Default.LGF
— Runs default logic (used in both Planning and Rate applications)
Allocation.LGF
— Runs allocations (used in the Planning application)
FX_Trans.LGF
— Runs currency conversions (used in the Planning application)
Logic files for the Consolidation application (located in \Webfolders\<AppSet>\SystemLibrary\Logic Library\)
:
CarryForward.LGF
— Runs carry forward business rules
FX_Trans.LGF
— Runs currency conversion
Stored_procedure_wrapper.LGL
— Logic library of business rules
Color Coding in the Logic Library
Logic instructions that start with * in the library files appear in blue. Words that start with * but are not valid logic instructions appear in red. The system considers this invalid syntax. Comments in logic script that start with // appear in gray.
Using Multi-line Instructions in Script Logic
If you use a multi-line instruction, such as *WHEN/*ENDWHEN, and you type the instruction *WHEN, for example, the ending instruction *ENDWHEN is typed automatically by the system when you press ENTER.
Validating Logic
You can validate files open in the Logic Library using the menu commands Validate Only or Validate and Save in the action pane.
Invalid syntax, member name, dimension name, and dimension property is marked in red and with italic font. Dimension member formulas in the dimension sheet fail with an error message, but invalid syntax coloring is not applied.
The validation only catches the first invalid dimension member or property name, and any subsequent invalid dimensions are ignored.
If you save a logic file leaving the invalid syntax, and invalid dimension names, member names, property names, only the invalid instructions appear in red when it is reopened. You must revalidate to see the invalid dimension, member, and property names in red.
Two types of messages are shown in a results window: one for the validation of the executed file and one for the syntax validation. If the execution part of the validation passes, the system creates the file <LogicName>.LGX, regardless of the result of the syntax validation. The syntax validation results are changed to red, as described above.
Note
Script logic statements are case-insensitive, as are all application set, application, and dimension and member names.
Default logic
Default logic is a special logic statement that is executed on every write back to an application. All logic in Default.LGF
runs after data sends.
Having all of your logic in the Default.LGF
logic file might become unmanageable. Therefore you can create other logic files, such as FXTrans.LGF
for foreign currency translation and ICElim.LGF
for
intercompany eliminations.
You can run the Default.LGF
and FXTrans.LGF
logic files using Data Manager packages, such as Default Formula, or FX Restatement. (An allocation logic example is provided but there is no Data Manager package provided for
allocations.) For more information, see Advanced Logic using Data Manager, below.
Your default logic can contain an INCLUDE statement to execute specific logic in real-time, such as currency translation if desired, rather than having to run a separate batch process.
System Constants File
The system constants file (System_Constants.LGL
) is the logic file that maps your dimension names for an application to the standard Planning and Consolidation logic. By updating the dimension constants file with your dimensions, you avoid having to change
or rewrite any of the standard functions that are included with Planning and Consolidation.
The system constants file is located in the \\root\Data\Webfolders\<AppSet>\AdminApp\<App>
folder.
MDX Library File
The library folder \Webfolders\<AppSet>\SystemLibrary\Logic Library\
contains the MDXlib.LGL
file that can be used to store MDX financial functions. You can use the *SYSLIB statement
to include the MDX financial function in MDXlib.lgl.
Advanced Logic using Data Manager
While default logic is executed immediately after data is sent, and you can see the results immediately, advanced logic can also be triggered each time the system sends data to the database. Advanced logic is run from Data Manager for batch processing of formulas. Using Data Manager to execute logic formulas is useful for calculations that do not need to be executed immediately. For example, you may decide to wait until all data has been entered in the local currency before generating the translated amounts in reporting currencies. For more information, see Data Manager.