Implementing Allocations
The Solutions Framework includes a starter kit for implementing allocations, deployed as a data table input app named ‘Manage Allocations’. While most of the functionality related to allocations is contained in the Solutions Framework code libraries, the data table and manage allocations app are fully customizable.
Allocations is implemented with the following components:
- Data Table LVAPP_AREAS, deployed during install/upgrade.
- Data Table LVAPP_ALLOCRUN, deployed during install/upgrade.
- Data Table APP_ALLOC, deployed during implementation.
- AREA code library, refer to Longview Developer’s Guide for details.
- ALLOC code library, refer to Longview Developer’s Guide for details.
- Example Apps: Manage Allocations, Export Allocations, and Import Allocations.
- App: Run Allocations.
- Event rule, deployed during install/upgrade.
- Allocation event, deployed during install/upgrade.
The APP_ALLOC table must be created during implementation as this table can be customized to suit the customer. For more details, see Creating the APP_ALLOC data table.
The Manage Allocations app is provided as an example and can be duplicated and edited to suit the customer. For more details, see The example manage allocations app.
The Export Allocations app is provided as an example and can be duplicated and edited to suit the customer. For more details, see The example export allocations app.
The Import Allocations app is provided as an example and can be duplicated and edited to suit the customer. For more details, see The example import allocations app.
LVAPP_AREAS Table - Overview
The LVAPP_AREAS table is used for storing data area definitions for the allocations in your system.
The LVAPP_AREAS table consists of the following columns:
Column Name | Type | Purpose |
---|---|---|
ID |
NUMBER |
Unique identifier for the data table row. |
RELID |
NUMBER |
Unique identifier for the allocation definition. For example, each allocation contains multiple data areas for different purposes. This column will provide the allocation its own specific ID. |
TYPE |
STRING |
Denotes the purpose of the data area. For example, in the Allocations module the types are:
Note: If using the LVAPP_AREAS table for custom apps, it is best practice to prefix your TYPE values for easier filtering. For example, all allocation types are prefixed with “ALLOC”. |
DIMENSION |
DIMENSION |
Stores the dimension for the data area row. |
ITEMNO |
NUMBER |
Stores a unique identifier for each symbol in an area within the same dimension. This would be a value other than 1 only in cases where multiple symbols have been selected for one data area in the same dimension. |
SYMBOL |
SYMBOL |
Stores the symbol for the data area row, based on the dimension in the DIMENSION column. |
LVAPP_ALLOCRUN Table - Overview
The LVAPP_ALLOCRUN table is used for storing allocations that have been triggered to run. Once an allocation has completed processing, it is removed from the LVAPP_ALLOCRUN table.
The LVAPP_ALLOCRUN table consists of the following columns:
Column Name | Type | Purpose |
---|---|---|
ID |
NUMBER |
Unique identifier for the data table row. |
ALLOCID |
NUMBER |
Unique identifier for the allocation definition. |
ALLOCPERIOD |
SYMBOL |
Stores the time period symbol the allocation was triggered to run on. Note: If an allocation was triggered on a parent time period, an individual row for each leaf time period under the selected parent would be created in the LVAPP_ALLOCRUN table. |
PROCESSORDER |
NUMBER |
Stores the numeric value to define the order in which the allocations will be processed if multiple allocations are selected to run at the same time. Allocations will be processed in ascending order, ensuring each allocation has been submitted and rolled up before the next allocation is run. |
Creating the APP_ALLOC data table
The Solutions Framework contains scripts for defining the APP_ALLOC data table. It is filled out with the standard columns but can be modified as required to suit the customer’s needs. You will find the SQL script file in the DataServerRepositories\<Longview Identifier>
within the installation folder.
There are two flavors of the file, one that contains the TMEPERIOD column and one that does not. Use the one containing TIMEPERIOD if you want to vary your allocation definitions by time period. The files will be named:
- SQL Server:
- APP_ALLOC_SQLServer.sql
- APP_ALLOC_with_TIME_SQLServer.sql
- Oracle:
- APP_ALLOC_Oracle.sql
- APP_ALLOC_with_TIME_Oracle.sql
The following columns are required for the table to be compliant with the Solutions Framework:
- ID
- ACTIVE
- CATEGORY
- DESCRIPTION
- MARKUPPCT
- ALLOCTYPE
- ALLOCPCT
- PROCESSORDER
- USESOURCEOF
- SOURCE
- SOURCEEX
- SOURCEOF
- TARGET
- TARGETEX
- PATTERN
Run Allocations App
Run Allocations is a standard out of box app that allows you to trigger active allocations in your system.
For more information on the Run Allocations app, see the “Run Allocations” section in the Solutions Framework Administrator Guide.
Allocation Event Rules
Event rules are deployed during an install/upgrade. These rules are used in conjunction with the Run Allocations App to manually trigger the allocation event.
Event Rules - Longview Transfer Pricing
For a Longview Transfer Pricing deployment, there is one rule created to run the allocations:
5700000
KLX(EVNT_5700000###, #ALL, DIM2SET, DIM3SET, DIM4SET, DIM5SET, DIM6SET, DIM7SET)=000:RUNPROC("applications\Solutions\Events\ALLOC\Event.lvpro")
Event Rules - Longview Close
For a Longview Close deployment, there is one rule created for each of the following time periods, with all non-standard dimensions symbols set to <DIMENSION>_ Default in the event rule.
- Actual_PA###
- Forecast_PA###
- Budget_PA###
5400000
KLX(EVNT_5400000###, Actual_PA###, ENTITIES_Default, DATAVIEWS_Default, SCENARIOS_Default, CURRENCIES_Default)=000:RUNPROC("applications\Solutions\Events\ALLOC\Event.lvpro")
5400001
KLX(EVNT_5400000###, Forecast_PA###, ENTITIES_Default, DATAVIEWS_Default, SCENARIOS_Default, CURRENCIES_Default)=000:RUNPROC("applications\Solutions\Events\ALLOC\Event.lvpro")
5400002
KLX(EVNT_5400000###, Budget_PA###, ENTITIES_Default, DATAVIEWS_Default, SCENARIOS_Default, CURRENCIES_Default)=000:RUNPROC("applications\Solutions\Events\ALLOC\Event.lvpro")
Allocation Event
The allocation event (ALLOC) is deployed during an install/upgrade.
The allocation event will perform the following:
- Retrieve the source data area.
- Transfer the pattern to the target data area.
- Apply any target exceptions.
- Calculate the pattern ratio.
- Calculate the allocation values.
- Calculate the source offset value.
Retrieving the Source Data Area
The allocation event will:
- Download the source data area.
- Zero out any source exceptions.
- Transfer the source data area to the source offset data area (for processing in a later stage of the event).
- The source value is calculated as:
(Source Value) * (100% + Markup %) * (Allocation %)
Note:
If the source symbol is a parent and the source symbol is the same as the target symbol - the source value will be calculated for each intersection.
The source, source offset and source exception data areas are defined in the Manage Allocations App and stored in the LVAPP_AREAS table.
If you are using parallel allocation execution, you may have multiple allocation events executing and each will run for a separate account under the EVNT_symbol. If allocations are triggered for multiple time periods, these will execute in parallel if parallel event rules have been setup. See Configuring Parallel Allocation Execution.
Transferring the pattern to the target area
The pattern is transferred from the defined pattern data area to the defined target data area.
Note:
- This step will be omitted for any allocations of type “Direct Charge” as there is no pattern defined.
- If the target symbol is a parent and the pattern symbol is not the same as the target symbol, the pattern will be copied to each individual symbol below the parent.
- The target and pattern data areas are defined in the Manage Allocations App and stored in the LVAPP_AREAS table.
Applying any target exceptions
Once the pattern has been transferred to the target area, any target exceptions defined will be zeroed out.
Note: This step will be omitted for any allocations of type “Rate” or ”Direct Charge”
A rollup of the target data area will be performed to calculate the new pattern total taking into account any exceptions.
Note: The target exception data area is defined in the Manage Allocations App and stored in the LVAPP_AREAS table.
Calculating the pattern ratio
The pattern ratio is calculated by dividing the pattern that has been transferred by the pattern denominator.
Note: This step will be omitted for any allocations of type “Rate”, as it is assumed the values are already stored as percentages. It will also be omitted for any allocation of type “Direct Charge” as there is no pattern set.
The pattern denominator value will be defined by an intersection, but the symbols for each dimension in the intersection will vary depending on the following conditions:
Condition | Denominator |
---|---|
Target symbol is a parent AND Pattern symbol is not the same as the target symbol |
Pattern symbol will be used |
Target symbol is a parent AND Pattern symbol is the same as the target symbol |
Target symbol will be used |
Target symbol is not a parent |
Target symbol will be used |
Calculating the allocation values
For allocations of type Pattern or Rate, the target value is than calculated by multiplying the source values by the pattern values or rate values. For allocations of type Direct Charge, the target value is than calculated by transferring the source value to the target.
Calculating the source offset value
The source data area is transferred to the source offset data area. The source offset is used to zero out the source value allocated so that allocated values do not change the original consolidated values.
The source offset is calculated by the following formula:
(Source Value) * (-1) * (100% + Markup %) * (Allocation %)
Note:
The source offset is optional. If no source offset is defined, this step will be omitted.
The source and source offset data areas are defined in the Manage Allocations App and stored in the LVAPP_AREAS table.
Configuring Parallel Allocation Execution
Parallel allocation execution allows you to configure allocations to trigger as parallel event triggers rather than executing all allocation in sequence in a single event trigger.
To enable parallel allocation execution
- Launch Application Administrator.
- Select Tools > Parallel Event Rule Setup from the menu.
- Add a line for the allocation event id and the maximum number of parallel executions.
- For Tax and Transfer Pricing systems: 5700000, <max> (0 to 32)
- For Other systems 5400000, <max> (0 to 32) (0 or 1 means single execution only)
Note: For more details see “Specifying Parallel Event rules” in the Longview Application Administrator Guide.
- In the Server Explorer navigate to Attributes > SYSTEM.
- Optionally, locate the attribute
ASAllocParallel
and set its value to TRUE. - Optionally, locate the attribute
ASAllocParallelUseCategory
and set its value to TRUE. This will allow you to use the category value of allocations to group related dependant allocations together. - Restart the Longview server to enable parallel event execution.
Parallel allocation execution rules
The following rules apply to parallel allocation execution:
Parallel rule setup | Parallel | Use Category | Execution |
---|---|---|---|
No, 0 or 1 |
N/A |
N/A |
All allocations run in sequence (each period triggered independently) |
Yes, 2 – 32 |
FALSE |
FALSE |
Allocations run in sequence with allocations in different time periods running in parallel |
Yes, 2 – 32 |
TRUE |
FALSE |
Each allocation with processing order = 0 runs in parallel (each period triggered independently) All allocations with processing order <> 0 run in sequence (each period triggered independently) |
Yes, 2 – 32 |
TRUE |
TRUE |
Each allocation with processing order = 0 runs in parallel (each period triggered independently) All allocations with processing order <> 0 in the same category run in sequence (each period triggered independently, and category triggered independently) |
Note: Longview Close is configured by default to run allocations in Actual, Budget and Forecast time periods as separate events. Enabling parallel allocation execution will further sub-divide these into additional parallel executions.