Skip to main content

ForecastAllocation

Versions

v1.0.0

Basic Information

Class Name: ForecastAllocation

Title: Forecast Allocation

Version: 1.0.0

Author: Connor Stabnick

Organization: OneStream

Creation Date: 2024-02-28

Default Routine Memory Capacity: 2.0 GB

Tags

Allocation, Time Series, Regression, Statistics

Description

Short Description

Distributes aggregate forecasts to more granular levels using historical patterns.

Long Description

A routine that breaks down high-level forecasts into more detailed allocations by analyzing historical data patterns. When your forecast is at a summarized level but you need predictions at a more granular dimension, this routine uses historical contribution patterns to distribute the forecast values. The routine offers three allocation methods: simple_spread (equal distribution), historical_average_allocation (uses overall historical percentages), and lag_adjusted_historical_spread (uses recent rolling window patterns). Optionally adds time-derived dimensions (e.g., Day of Week, Month of Year) as additional grouping factors to refine allocation percentages.

Use Cases

1. Products Within Stores

In the case there is a forecast that predicts sales at various stores, one could use a method of the ForecastAllocation routine to get a rough approximation of the sales of individual products at the stores, despite the products not being included as part of the original forecast. To set this up, the historical table provided will need its dimension columns set to the fields which include the same data used as the targets in the provided forecast table. The historical table's value column should be set to the value being forecasted for, such as sales. The historical table's allocation columns would be the products in this example. When providing the forecast table, ensure that the dimension columns match the historical table. The methods defined for this routine will then be able to provide a forecast for the products at the stores. For added flexibility, the routine also allows for the user to provide additional date allocation groupings to factor into the allocation percentage calculation.

2. Stores Within Regions By Month

In the case there is a forecast that predicts sales across various regions, where these regions may include a number of stores, one could use a method of the ForecastAllocation routine to get a rough approximation of the sales of individual stores within the regions, despite the stores not being included as part of the original forecast. To set this up, the historical table provided will need its dimension columns set to the fields which include the same data used as the targets in the provided forecast table. This should include the region, and may include other targets provided they were included in the historical set as well. The date allocation groupings should include the month, to break down the forecast by month. Then, the month will be used as part of the allocation percentage calculation to provide the desired granularity. Each of the methods defined for this routine will then be able to provide a forecast for the stores within the regions. Knowing sales can vary greatly by location, it is likely that the lag_adjusted_historical_spread or simple_average_historical_spread method will provide the most accurate results.

Routine Methods

1. Historical Average Allocation (Method)
  • Method: historical_average_allocation
    • Type: Method

    • Memory Capacity: 2.0 GB

    • Allow In-Memory Execution: No

    • Read Only: Yes

    • Method Limits: Currently, this method can only support up to 5K forecasted targets and completes in 2 minutes with 60GB of allocated memory. This was tested at the weekly level with 52 weeks of historical data and a forecast horizon of 26 weeks. Historical data and forecasts beyond these levels at the weekly granularity are not recommended as both factors increase computational complexity.

    • Outputs Dynamic Artifacts: No

    • Short Description:

      • Uses historical data to calculate average percentages for allocation columns.
    • Detailed Description:

      • Allocation method that uses the historical data to calculate average percentages for the allocation columns within their dimensions, then uses this information to expand the forecast by multiplying the forecast values by the average percentages. The historical data will be grouped by the dimensions and the allocation columns, then the sum of the historical data will be calculated. The sum will be used to calculate the percentage that the allocation columns accounted for in the historical data. This will be calculated as a ratio against the historical data being grouped by the dimensions alone. This percentage will be used to expand the forecast data.
    • Inputs:

      • Required Input
        • Data Definition: The base parameters for the allocation routine.
          • Name: allocation_base
          • Tooltip:
            • Validation Constraints:
              • This input may be subject to other validation constraints at runtime.
          • Type: Must be an instance of Data Definition
          • Nested Model: Data Definition
            • Required Input
              • Historical Data: The historical data set used to compute the allocation table.
                • Name: historical_data_table
                • Tooltip:
                  • Validation Constraints:
                    • This input may be subject to other validation constraints at runtime.
                • Type: Must be an instance of The Historical Time Series Source Data
                • Nested Model: The Historical Time Series Source Data
                  • Required Input
                    • Source Connection: The connection type to use to access the source data.
                      • Name: data_connection
                      • Tooltip:
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: Must be an instance of Tabular Connection
                      • Nested Model: Tabular Connection
                        • Required Input
                          • Connection: The connection type to use to access the source data.
                            • Name: tabular_connection
                            • Tooltip:
                              • Validation Constraints:
                                • This input may be subject to other validation constraints at runtime.
                            • Type: Must be one of the following
                              • SQL Server Connection
                                • Required Input
                                  • Database Resource: The name of the database resource to connect to.
                                    • Name: database_resource
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                                  • Database Name: The name of the database to connect to.
                                    • Name: database_name
                                    • Tooltip:
                                      • Detail:
                                        • Note: If you don’t see the database name that you are looking for in this list, it is recommended that you first move the data to be used within a database that is available within this list.
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                                  • Table Name: The name of the table to use.
                                    • Name: table_name
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                              • MetaFileSystem Connection
                                • Required Input
                                  • Connection Key: The MetaFileSystem connection key.
                                    • Name: connection_key
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: MetaFileSystemConnectionKey
                                  • File Path: The full file path to the file to ingest.
                                    • Name: file_path
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                              • Partitioned MetaFileSystem Connection
                                • Required Input
                                  • Connection Key: The MetaFileSystem connection key.
                                    • Name: connection_key
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: MetaFileSystemConnectionKey
                                  • File Type: The type of files to read from the directory.
                                    • Name: file_type
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: FileExtensions_
                                  • Directory Path: The full directory path containing partitioned tabular files.
                                    • Name: directory_path
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                    • Dimension Columns: The columns to use as dimensions. This should match the Dimension Columns set for the forecast data, and should not include any of the Allocation Columns.
                      • Name: dimension_columns
                      • Tooltip:
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: list[str]
                    • Date Column: The column to use as the date.
                      • Name: date_column
                      • Tooltip:
                        • Detail:
                          • The date column must in a DateTime readable format.
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: str
                    • Value Column: The column to use as the value.
                      • Name: value_column
                      • Tooltip:
                        • Detail:
                          • The value column must be a numeric (int, float, double, decimal, etc.) column.
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: str
                    • Allocation Columns: The columns to allocate data for based on a defined strategy. This should not include any of the dimension columns.
                      • Name: allocation_columns
                      • Tooltip:
                        • Detail:
                          • These columns are not part of the forecast. An approximate forecast value will be calculated for these columns based on the method invoked.
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: list[str]
              • Forecast Data: The forecast data set that the allocation table is applied to.
                • Name: forecast_data_table
                • Tooltip:
                  • Validation Constraints:
                    • This input may be subject to other validation constraints at runtime.
                • Type: Must be an instance of The Forecast Time Series Source Data
                • Nested Model: The Forecast Time Series Source Data
                  • Required Input
                    • Source Connection: The connection type to use to access the source data.
                      • Name: data_connection
                      • Tooltip:
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: Must be an instance of Tabular Connection
                      • Nested Model: Tabular Connection
                        • Required Input
                          • Connection: The connection type to use to access the source data.
                            • Name: tabular_connection
                            • Tooltip:
                              • Validation Constraints:
                                • This input may be subject to other validation constraints at runtime.
                            • Type: Must be one of the following
                              • SQL Server Connection
                                • Required Input
                                  • Database Resource: The name of the database resource to connect to.
                                    • Name: database_resource
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                                  • Database Name: The name of the database to connect to.
                                    • Name: database_name
                                    • Tooltip:
                                      • Detail:
                                        • Note: If you don’t see the database name that you are looking for in this list, it is recommended that you first move the data to be used within a database that is available within this list.
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                                  • Table Name: The name of the table to use.
                                    • Name: table_name
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                              • MetaFileSystem Connection
                                • Required Input
                                  • Connection Key: The MetaFileSystem connection key.
                                    • Name: connection_key
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: MetaFileSystemConnectionKey
                                  • File Path: The full file path to the file to ingest.
                                    • Name: file_path
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                              • Partitioned MetaFileSystem Connection
                                • Required Input
                                  • Connection Key: The MetaFileSystem connection key.
                                    • Name: connection_key
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: MetaFileSystemConnectionKey
                                  • File Type: The type of files to read from the directory.
                                    • Name: file_type
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: FileExtensions_
                                  • Directory Path: The full directory path containing partitioned tabular files.
                                    • Name: directory_path
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                    • Dimension Columns: The columns to use as dimensions. This should match the Dimension Columns set for the historical data.
                      • Name: dimension_columns
                      • Tooltip:
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: list[str]
                    • Date Column: The column to use as the date.
                      • Name: date_column
                      • Tooltip:
                        • Detail:
                          • The date column must in a DateTime readable format.
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: str
                    • Value Column: The column to use as the value.
                      • Name: value_column
                      • Tooltip:
                        • Detail:
                          • The value column must be a numeric (int, float, double, decimal, etc.) column.
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: str
              • Data Frequency: The frequency (time granularity) of the source data.
                • Name: frequency_of_data
                • Tooltip:
                  • Validation Constraints:
                    • This input may be subject to other validation constraints at runtime.
                • Type: DataFrequencyTypes_
              • Date Allocation Groupings: Additional date groups to include as part of how the allocations are grouped, this is included with the table's dimension columns as an additional dimension.
                • Name: date_allocation_groupings
                • Tooltip:
                  • Validation Constraints:
                    • This input may be subject to other validation constraints at runtime.
                • Type: Must be an instance of Date Allocation Grouping
                • Nested Model: Date Allocation Grouping
                  • Required Input
                    • Date Allocation Groupings: Additional date groups to include as part of how the allocations are grouped, this is included with the table's dimension columns as an additional dimension.
                      • Name: date_allocations
                      • Tooltip:
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: list[AllocationFrequencyTypes_]
              • Fallback Date Allocation Groupings: Additional fallback date groups to include as part of how the allocations are grouped, these are included with the table's dimension columns as an additional dimension if needed.
                • Name: fallback_allocation_groupings
                • Tooltip:
                  • Validation Constraints:
                    • This input may be subject to other validation constraints at runtime.
                • Type: list[DateAllocationGrouping]
        • Date Range Lookback Unit: The unit of the date range lookback to use for the historical data, the unit to take however many steps back.
          • Name: date_range_lookback_unit
          • Tooltip:
            • Validation Constraints:
              • This input may be subject to other validation constraints at runtime.
          • Type: DateRangeUnits_
        • Date Range Lookback Steps: The number of steps to lookback from the end of the historical data, steps taken in units defined by Date Range Lookback Unit.
          • Name: date_range_lookback_steps
          • Tooltip:
            • Validation Constraints:
              • This input may be subject to other validation constraints at runtime.
          • Type: int
    • Artifacts:

      • Allocation Output: The dataset with the selected allocation having been applied.
        • Qualified Key Annotation: output_data
        • Aggregate Artifact: False
        • In-Memory Json Accessible: False
        • File Annotations:
          • artifacts_/@output_data/data_/data_<int>.parquet
            • A partitioned set of parquet files where each file will have no more than 1000000 rows.
2. Lag Adjusted Historical Spread (Method)
  • Method: lag_adjusted_historical_spread
    • Type: Method

    • Memory Capacity: 2.0 GB

    • Allow In-Memory Execution: No

    • Read Only: Yes

    • Method Limits: Currently, this method can only support up to 5K forecasted targets and completes in 2 minutes with 60GB of allocated memory. This was tested at the weekly level with 52 weeks of historical data and a forecast horizon of 26 weeks. Historical data and forecasts beyond these levels at the weekly granularity are not recommended as both factors increase computational complexity.

    • Outputs Dynamic Artifacts: No

    • Short Description:

      • Historical average allocation method with forecast lag adjustment.
    • Detailed Description:

      • Allocation method that uses the historical data to calculate average percentages for the allocation columns, adjusted for each forecast date by the provided window and lag. Data from the historical data table will be grouped by the dimensions and the allocation columns, then a rolling sum will be calculated for the historical data's value column. The rolling sum will be used to calculate the percentage of the historical data that the allocation columns account for. This will be calculated as a ratio against the historical data being grouped by the dimensions alone. This percentage will be used to expand the forecast data for the allocation columns. If the defined lag and window exclude data, the routine will not be able to provide an allocation for the forecast data, and these records will not have values.
    • Inputs:

      • Required Input
        • Data Definition: The base parameters for the allocation routine.
          • Name: allocation_base
          • Tooltip:
            • Validation Constraints:
              • This input may be subject to other validation constraints at runtime.
          • Type: Must be an instance of Data Definition
          • Nested Model: Data Definition
            • Required Input
              • Historical Data: The historical data set used to compute the allocation table.
                • Name: historical_data_table
                • Tooltip:
                  • Validation Constraints:
                    • This input may be subject to other validation constraints at runtime.
                • Type: Must be an instance of The Historical Time Series Source Data
                • Nested Model: The Historical Time Series Source Data
                  • Required Input
                    • Source Connection: The connection type to use to access the source data.
                      • Name: data_connection
                      • Tooltip:
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: Must be an instance of Tabular Connection
                      • Nested Model: Tabular Connection
                        • Required Input
                          • Connection: The connection type to use to access the source data.
                            • Name: tabular_connection
                            • Tooltip:
                              • Validation Constraints:
                                • This input may be subject to other validation constraints at runtime.
                            • Type: Must be one of the following
                              • SQL Server Connection
                                • Required Input
                                  • Database Resource: The name of the database resource to connect to.
                                    • Name: database_resource
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                                  • Database Name: The name of the database to connect to.
                                    • Name: database_name
                                    • Tooltip:
                                      • Detail:
                                        • Note: If you don’t see the database name that you are looking for in this list, it is recommended that you first move the data to be used within a database that is available within this list.
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                                  • Table Name: The name of the table to use.
                                    • Name: table_name
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                              • MetaFileSystem Connection
                                • Required Input
                                  • Connection Key: The MetaFileSystem connection key.
                                    • Name: connection_key
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: MetaFileSystemConnectionKey
                                  • File Path: The full file path to the file to ingest.
                                    • Name: file_path
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                              • Partitioned MetaFileSystem Connection
                                • Required Input
                                  • Connection Key: The MetaFileSystem connection key.
                                    • Name: connection_key
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: MetaFileSystemConnectionKey
                                  • File Type: The type of files to read from the directory.
                                    • Name: file_type
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: FileExtensions_
                                  • Directory Path: The full directory path containing partitioned tabular files.
                                    • Name: directory_path
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                    • Dimension Columns: The columns to use as dimensions. This should match the Dimension Columns set for the forecast data, and should not include any of the Allocation Columns.
                      • Name: dimension_columns
                      • Tooltip:
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: list[str]
                    • Date Column: The column to use as the date.
                      • Name: date_column
                      • Tooltip:
                        • Detail:
                          • The date column must in a DateTime readable format.
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: str
                    • Value Column: The column to use as the value.
                      • Name: value_column
                      • Tooltip:
                        • Detail:
                          • The value column must be a numeric (int, float, double, decimal, etc.) column.
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: str
                    • Allocation Columns: The columns to allocate data for based on a defined strategy. This should not include any of the dimension columns.
                      • Name: allocation_columns
                      • Tooltip:
                        • Detail:
                          • These columns are not part of the forecast. An approximate forecast value will be calculated for these columns based on the method invoked.
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: list[str]
              • Forecast Data: The forecast data set that the allocation table is applied to.
                • Name: forecast_data_table
                • Tooltip:
                  • Validation Constraints:
                    • This input may be subject to other validation constraints at runtime.
                • Type: Must be an instance of The Forecast Time Series Source Data
                • Nested Model: The Forecast Time Series Source Data
                  • Required Input
                    • Source Connection: The connection type to use to access the source data.
                      • Name: data_connection
                      • Tooltip:
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: Must be an instance of Tabular Connection
                      • Nested Model: Tabular Connection
                        • Required Input
                          • Connection: The connection type to use to access the source data.
                            • Name: tabular_connection
                            • Tooltip:
                              • Validation Constraints:
                                • This input may be subject to other validation constraints at runtime.
                            • Type: Must be one of the following
                              • SQL Server Connection
                                • Required Input
                                  • Database Resource: The name of the database resource to connect to.
                                    • Name: database_resource
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                                  • Database Name: The name of the database to connect to.
                                    • Name: database_name
                                    • Tooltip:
                                      • Detail:
                                        • Note: If you don’t see the database name that you are looking for in this list, it is recommended that you first move the data to be used within a database that is available within this list.
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                                  • Table Name: The name of the table to use.
                                    • Name: table_name
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                              • MetaFileSystem Connection
                                • Required Input
                                  • Connection Key: The MetaFileSystem connection key.
                                    • Name: connection_key
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: MetaFileSystemConnectionKey
                                  • File Path: The full file path to the file to ingest.
                                    • Name: file_path
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                              • Partitioned MetaFileSystem Connection
                                • Required Input
                                  • Connection Key: The MetaFileSystem connection key.
                                    • Name: connection_key
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: MetaFileSystemConnectionKey
                                  • File Type: The type of files to read from the directory.
                                    • Name: file_type
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: FileExtensions_
                                  • Directory Path: The full directory path containing partitioned tabular files.
                                    • Name: directory_path
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                    • Dimension Columns: The columns to use as dimensions. This should match the Dimension Columns set for the historical data.
                      • Name: dimension_columns
                      • Tooltip:
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: list[str]
                    • Date Column: The column to use as the date.
                      • Name: date_column
                      • Tooltip:
                        • Detail:
                          • The date column must in a DateTime readable format.
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: str
                    • Value Column: The column to use as the value.
                      • Name: value_column
                      • Tooltip:
                        • Detail:
                          • The value column must be a numeric (int, float, double, decimal, etc.) column.
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: str
              • Data Frequency: The frequency (time granularity) of the source data.
                • Name: frequency_of_data
                • Tooltip:
                  • Validation Constraints:
                    • This input may be subject to other validation constraints at runtime.
                • Type: DataFrequencyTypes_
              • Date Allocation Groupings: Additional date groups to include as part of how the allocations are grouped, this is included with the table's dimension columns as an additional dimension.
                • Name: date_allocation_groupings
                • Tooltip:
                  • Validation Constraints:
                    • This input may be subject to other validation constraints at runtime.
                • Type: Must be an instance of Date Allocation Grouping
                • Nested Model: Date Allocation Grouping
                  • Required Input
                    • Date Allocation Groupings: Additional date groups to include as part of how the allocations are grouped, this is included with the table's dimension columns as an additional dimension.
                      • Name: date_allocations
                      • Tooltip:
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: list[AllocationFrequencyTypes_]
              • Fallback Date Allocation Groupings: Additional fallback date groups to include as part of how the allocations are grouped, these are included with the table's dimension columns as an additional dimension if needed.
                • Name: fallback_allocation_groupings
                • Tooltip:
                  • Validation Constraints:
                    • This input may be subject to other validation constraints at runtime.
                • Type: list[DateAllocationGrouping]
        • Lookback Window: The number of periods to look back in the historical data.
          • Name: lookback_window
          • Tooltip:
            • Detail:
              • The periods are based on the frequency of the data (ex: 1 would be 1 month for a monthly dataset).
            • Validation Constraints:
              • This input may be subject to other validation constraints at runtime.
          • Type: int
        • Lag: The lag (forecast range) of the forecast data.
          • Name: lag
          • Tooltip:
            • Detail:
              • The unit of the lag is the same as the frequency of the data (ex: 1 would be 1 month for a monthly dataset).
            • Validation Constraints:
              • This input may be subject to other validation constraints at runtime.
          • Type: int
    • Artifacts:

      • Allocation Output: The dataset with the selected allocation having been applied.
        • Qualified Key Annotation: output_data
        • Aggregate Artifact: False
        • In-Memory Json Accessible: False
        • File Annotations:
          • artifacts_/@output_data/data_/data_<int>.parquet
            • A partitioned set of parquet files where each file will have no more than 1000000 rows.
3. Simple Spread (Method)
  • Method: simple_spread
    • Type: Method

    • Memory Capacity: 2.0 GB

    • Allow In-Memory Execution: No

    • Read Only: Yes

    • Method Limits: Currently, this method can only support up to 5K forecasted targets and completes in 2 minutes with 60GB of allocated memory. This was tested at the weekly level with 52 weeks of historical data and a forecast horizon of 26 weeks. Historical data and forecasts beyond these levels at the weekly granularity are not recommended as both factors increase computational complexity.

    • Outputs Dynamic Artifacts: No

    • Short Description:

      • Simple spread method for allocation.
    • Detailed Description:

      • A routine which will evenly allocate the forecast values to the historical data table's allocation columns within the defined dimension columns. Any defined date allocation groupings will be used with the dimension columns as the dimensions. The allocation percentage will be calculated as 1 divided by the number of unique allocations for each dimension grouping. This will be used to expand the forecast data.
    • Inputs:

      • Required Input
        • Data Definition: The base parameters for the allocation routine.
          • Name: allocation_base
          • Tooltip:
            • Validation Constraints:
              • This input may be subject to other validation constraints at runtime.
          • Type: Must be an instance of Data Definition
          • Nested Model: Data Definition
            • Required Input
              • Historical Data: The historical data set used to compute the allocation table.
                • Name: historical_data_table
                • Tooltip:
                  • Validation Constraints:
                    • This input may be subject to other validation constraints at runtime.
                • Type: Must be an instance of The Historical Time Series Source Data
                • Nested Model: The Historical Time Series Source Data
                  • Required Input
                    • Source Connection: The connection type to use to access the source data.
                      • Name: data_connection
                      • Tooltip:
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: Must be an instance of Tabular Connection
                      • Nested Model: Tabular Connection
                        • Required Input
                          • Connection: The connection type to use to access the source data.
                            • Name: tabular_connection
                            • Tooltip:
                              • Validation Constraints:
                                • This input may be subject to other validation constraints at runtime.
                            • Type: Must be one of the following
                              • SQL Server Connection
                                • Required Input
                                  • Database Resource: The name of the database resource to connect to.
                                    • Name: database_resource
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                                  • Database Name: The name of the database to connect to.
                                    • Name: database_name
                                    • Tooltip:
                                      • Detail:
                                        • Note: If you don’t see the database name that you are looking for in this list, it is recommended that you first move the data to be used within a database that is available within this list.
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                                  • Table Name: The name of the table to use.
                                    • Name: table_name
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                              • MetaFileSystem Connection
                                • Required Input
                                  • Connection Key: The MetaFileSystem connection key.
                                    • Name: connection_key
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: MetaFileSystemConnectionKey
                                  • File Path: The full file path to the file to ingest.
                                    • Name: file_path
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                              • Partitioned MetaFileSystem Connection
                                • Required Input
                                  • Connection Key: The MetaFileSystem connection key.
                                    • Name: connection_key
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: MetaFileSystemConnectionKey
                                  • File Type: The type of files to read from the directory.
                                    • Name: file_type
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: FileExtensions_
                                  • Directory Path: The full directory path containing partitioned tabular files.
                                    • Name: directory_path
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                    • Dimension Columns: The columns to use as dimensions. This should match the Dimension Columns set for the forecast data, and should not include any of the Allocation Columns.
                      • Name: dimension_columns
                      • Tooltip:
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: list[str]
                    • Date Column: The column to use as the date.
                      • Name: date_column
                      • Tooltip:
                        • Detail:
                          • The date column must in a DateTime readable format.
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: str
                    • Value Column: The column to use as the value.
                      • Name: value_column
                      • Tooltip:
                        • Detail:
                          • The value column must be a numeric (int, float, double, decimal, etc.) column.
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: str
                    • Allocation Columns: The columns to allocate data for based on a defined strategy. This should not include any of the dimension columns.
                      • Name: allocation_columns
                      • Tooltip:
                        • Detail:
                          • These columns are not part of the forecast. An approximate forecast value will be calculated for these columns based on the method invoked.
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: list[str]
              • Forecast Data: The forecast data set that the allocation table is applied to.
                • Name: forecast_data_table
                • Tooltip:
                  • Validation Constraints:
                    • This input may be subject to other validation constraints at runtime.
                • Type: Must be an instance of The Forecast Time Series Source Data
                • Nested Model: The Forecast Time Series Source Data
                  • Required Input
                    • Source Connection: The connection type to use to access the source data.
                      • Name: data_connection
                      • Tooltip:
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: Must be an instance of Tabular Connection
                      • Nested Model: Tabular Connection
                        • Required Input
                          • Connection: The connection type to use to access the source data.
                            • Name: tabular_connection
                            • Tooltip:
                              • Validation Constraints:
                                • This input may be subject to other validation constraints at runtime.
                            • Type: Must be one of the following
                              • SQL Server Connection
                                • Required Input
                                  • Database Resource: The name of the database resource to connect to.
                                    • Name: database_resource
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                                  • Database Name: The name of the database to connect to.
                                    • Name: database_name
                                    • Tooltip:
                                      • Detail:
                                        • Note: If you don’t see the database name that you are looking for in this list, it is recommended that you first move the data to be used within a database that is available within this list.
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                                  • Table Name: The name of the table to use.
                                    • Name: table_name
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                              • MetaFileSystem Connection
                                • Required Input
                                  • Connection Key: The MetaFileSystem connection key.
                                    • Name: connection_key
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: MetaFileSystemConnectionKey
                                  • File Path: The full file path to the file to ingest.
                                    • Name: file_path
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                              • Partitioned MetaFileSystem Connection
                                • Required Input
                                  • Connection Key: The MetaFileSystem connection key.
                                    • Name: connection_key
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: MetaFileSystemConnectionKey
                                  • File Type: The type of files to read from the directory.
                                    • Name: file_type
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: FileExtensions_
                                  • Directory Path: The full directory path containing partitioned tabular files.
                                    • Name: directory_path
                                    • Tooltip:
                                      • Validation Constraints:
                                        • This input may be subject to other validation constraints at runtime.
                                    • Type: str
                    • Dimension Columns: The columns to use as dimensions. This should match the Dimension Columns set for the historical data.
                      • Name: dimension_columns
                      • Tooltip:
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: list[str]
                    • Date Column: The column to use as the date.
                      • Name: date_column
                      • Tooltip:
                        • Detail:
                          • The date column must in a DateTime readable format.
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: str
                    • Value Column: The column to use as the value.
                      • Name: value_column
                      • Tooltip:
                        • Detail:
                          • The value column must be a numeric (int, float, double, decimal, etc.) column.
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: str
              • Data Frequency: The frequency (time granularity) of the source data.
                • Name: frequency_of_data
                • Tooltip:
                  • Validation Constraints:
                    • This input may be subject to other validation constraints at runtime.
                • Type: DataFrequencyTypes_
              • Date Allocation Groupings: Additional date groups to include as part of how the allocations are grouped, this is included with the table's dimension columns as an additional dimension.
                • Name: date_allocation_groupings
                • Tooltip:
                  • Validation Constraints:
                    • This input may be subject to other validation constraints at runtime.
                • Type: Must be an instance of Date Allocation Grouping
                • Nested Model: Date Allocation Grouping
                  • Required Input
                    • Date Allocation Groupings: Additional date groups to include as part of how the allocations are grouped, this is included with the table's dimension columns as an additional dimension.
                      • Name: date_allocations
                      • Tooltip:
                        • Validation Constraints:
                          • This input may be subject to other validation constraints at runtime.
                      • Type: list[AllocationFrequencyTypes_]
              • Fallback Date Allocation Groupings: Additional fallback date groups to include as part of how the allocations are grouped, these are included with the table's dimension columns as an additional dimension if needed.
                • Name: fallback_allocation_groupings
                • Tooltip:
                  • Validation Constraints:
                    • This input may be subject to other validation constraints at runtime.
                • Type: list[DateAllocationGrouping]
        • Date Range Lookback Unit: The unit of the date range lookback to use for the historical data, the unit to take however many steps back.
          • Name: date_range_lookback_unit
          • Tooltip:
            • Validation Constraints:
              • This input may be subject to other validation constraints at runtime.
          • Type: DateRangeUnits_
        • Date Range Lookback Steps: The number of steps to lookback from the end of the historical data, steps taken in units defined by Date Range Lookback Unit.
          • Name: date_range_lookback_steps
          • Tooltip:
            • Validation Constraints:
              • This input may be subject to other validation constraints at runtime.
          • Type: int
    • Artifacts:

      • Allocation Output: The dataset with the selected allocation having been applied.
        • Qualified Key Annotation: output_data
        • Aggregate Artifact: False
        • In-Memory Json Accessible: False
        • File Annotations:
          • artifacts_/@output_data/data_/data_<int>.parquet
            • A partitioned set of parquet files where each file will have no more than 1000000 rows.

Interface Definitions

No interface definitions found for this routine

Developer Docs

Routine Typename: ForecastAllocation

Method NameArtifact Keys
historical_average_allocationoutput_data
lag_adjusted_historical_spreadoutput_data
simple_spreadoutput_data

Was this page helpful?