Incent Upload Orders
Summary
The incent upload orders
command allows developers to load sales transactions into Incent. Sales transactions generally represent a sales event (Example: customer account ABC123 bought 10 widgets from salesperson John Smith on April 1, 2016). Incent rules process sales orders to calculate commissions and bonuses for your company’s payees.
Orders define a record of sale for your company that is used to trigger compensation calculations. Each row in the orders table will produce a calculation within Incent. Orders often include information such as a unique identifier, customer, product, amount, date, and payee assignment. Additional custom fields allow each customer to load data relevant to their business. All columns on the order data can be used for calculation and reporting within Incent.
It is common to have multiple types of transactional data (revenue, bookings, invoices, calls booked, etc) that needs to be loaded into Incent. The orders table is usually categorized by “Order Type” field found on each order. The Order Type allows the Incent admin to easily write compensation rules that identify the proper orders for calculation.
Incent Admin Guide: https://helpcenter.xactlycorp.com/article/incent-administrator-orders-introduction/
The command transfers data from the staging.order_item
and staging.order_item_assignment
tables into Incent.
The following list provides the generic steps to follow:
DELETE
data from the following three tables. Archive rows as necessary as dictated by your business requirements:staging.order_item
,staging.order_item_assignment
, andstaging.order_item_validation_error
.- Perform any ETL transformations necessary to prepare your raw sales transaction data for upload into Incent.
INSERT
the transformed data intostaging.order_item
andstaging.order_item_assignment
. - Optional: Call
INCENT PURGE ORDERS
to remove old order batches from Incent that you want to reload. Note: Your implementation may use Incent’s Process Group features to purge orders from Incent and reset calculation results. Check with your project team before using Connect’sINCENT PURGE ORDERS
command. - Call
INCENT CREATE BATCHES
to create register any new batch names found in your staging data with Incent. - Optional: You may need to
INSERT
new customers, geographies, and/or products with Incent before proceeding. Refer to:INCENT UPLOAD CUSTOMERS
,INCENT UPLOAD GEOGRAPHIES
, andINCENT UPLOAD PRODUCTS
. - Call
INCENT VALIDATE ORDERS
to run Connect’s standard set of data validations against your staging table data. Validate runs against all rows and batches present in the staging tables. - Fix or archive any staging rows that failed validation. Connect cannot upload data into Incent if a single staging row has failed validation.
- Finally, call
INCENT UPLOAD ORDERS
to transfer validated staging data into Incent.
You may omit explicit calls to INCENT CREATE BATCHES
and INCENT VALIDATE ORDERS
. The INCENT UPLOAD ORDERS
command invokes them implicitly. However, if any rows fail during the implicit data validation, the upload will not load any staging rows into Incent. Xactly recommends explicitly calling the create batch and validate commands. This approach allows you to remove any staging orders that failed validation prior to running the upload command. The upload command will not load any staging data into Incent if a single row has failed validation and is not removed from the staging tables.
Syntax
incent [synchronous] upload orders; |
Parameters
Parameter
|
Description
|
---|---|
synchronous |
(Optional) The upload command runs asynchronously by default when invoked, i.e. control returns immediately to the calling program and the job runs in the background on the Connect server. Use the ‘synchronous’ keyword to force the Connect server to return control only after the upload completes.
When invoked asynchronously, you can track the status of the upload by querying the |
Details
Ensure you have registered a valid Incent username and password within Connect before invoking the upload command. INCENT
commands require valid credentials to modify data with Incent. Refer to INCENT CREDENTIAL.
The upload command operates against the complete set of rows found in the staging.order_item
and staging.order_item
assignment tables.
Many Incent implementations rely on a concept called, “trigger orders”. Your business requirements may specify that a Connect developer should manufacture trigger orders as part of routine data processing to affect how certain compensation rules fire. “Trigger orders” are simply sales orders that allow Incent rule writers to control the execution order and flow of their compensation rules. The concept is mentioned here because trigger orders are a type of sales order in Incent.
The command does not upload orders when the following Incent operations are already running: uploads to order staging, order validation, finalize, and order deletion.
The following tables describe the two staging tables used to move sales orders into Incent. Refer to INCENT VALIDATE ORDERS
for information on the staging.order_item_validation_error tables and messages it may contain regarding your staging table data. Use both tables when using the upload command. It is not possible to use each table in stand alone fashion, e.g. to upload employee assignments for a sales order that already exists in Incent.
staging.order_item – (Required) Insert sales order and line item detail into this table. | |||
Column Name | Data Type | Description | xactly Target Table |
---|---|---|---|
order_code | string | (Required) Incent enforces a constraint on order_code and item_code to uniquely identify a sales order. A single order_code can have many line items oritem_codes . |
|
item_code | string | (Required) Incent enforces a constraint on order_code and item_code to uniquely identify a sales order. Use item_code to assign different line items to a given order_code . |
|
source_id | decimal | Do not use. For internal Incent use only. |
|
amount | decimal | (Required) The total transactional amount for a given line_item . Typically, orders represent sales transaction events as currency values (1 widget sold for $50), but can also track non-currency decimal values. |
|
amount_unit_type_name | string | (Required) Should correspond to a valid xactly.xc_unit_type.name value. Many numeric values in Incent must be assigned to a unit type. Examples include: USD, EUR, quantity, and percent. |
|
discount | decimal | (Optional) Sometimes used in compensation rules and reporting to track any discount amounts or percentages given to a buyer for a given sales orders. The field’s use and context depends entirely on your company’s business requirements and Incent implementation. |
|
quantity | decimal | (Optional) Generally used to track the number of product units sold for the given order line item. |
|
incentive_date | date | (Required) Represents the transaction or close date of the order line item. Value determines the monthly period the line item is assigned to. Refer to staging.order_item.period_name and staging.order_item_batch_name. |
|
order_date | date | (Optional) Stores when a customer first placed the sales order. |
|
order_type_name | string | (Optional) Should correspond to a valid xactly.xc_order_type.name value. Business requirements may specify that compensation rules behave differently for different types of orders. |
|
batch_name | string | (Required) Incent requires every sales order row to be assigned to an order batch (refer to xactly.xc_user_batch) . Incent uses batch names to group transactions together to optimize processing in Incent’s processing queue. Xactly recommends limiting the number of orders in a batch to 20,000 rows. Please contact Xactly’s technical support team for additional guidance if you wish to use larger batch sizes.
A batch_name cannot cross monthly periods and cannot be assigned to more than one |
|
batch_type_name | string | (Optional) Every sales order batch in Incent must be assigned to a batch type name. Batch type names are used alongside Incent’s Process Group feature. Your compensation administrator defines the set of possible values. Queryxactly.xc_batch_type.name for the list of valid values.
Two choices exist when populating the stage table:
|
xactly.xc_user_batch.batch_type_id |
period_name | string | (Required) The leaf level, monthly period name for the given incentive_date . UseLookupPeriodName () function to return a period name given a date value. The functions helps you avoid cluttering your SQL statements with joins to thexactly.xc_period and xactly.xc_period_type tables. The upload command converts the period_name value given in the staging table to the appropriateperiod_id in the target table. |
|
product_name | string | (Optional) If populated, must correspond to a valid xactly.xc_product.name . UseINCENT UPLOAD PRODUCTS to upload new products into Incent or modify existing ones prior to uploading stage orders.
The upload will transform the |
|
customer_name | string | (Optional) If populated, must correspond to a valid xactly.xc_customer.name . Use INCENT UPLOAD CUSTOMERS to upload new customers into Incent or modify existing ones prior to uploading stage orders.
The upload will transform the |
|
geography_name | string | (Optional) If populated, must correspond to a valid xactly.xc_geography.name . Use INCENT UPLOAD GEOGRAPHIES to upload new geographies into Incent or modify existing ones prior to uploading stage orders.
The upload will transform the |
|
related_order_code | string | (Optional) Use related_order_code and related_item_code to associate a staging sales order with a different sales order that already exists in Incent. The related sales order may exist in a different batch and period. |
|
related_item_code | string | (Optional) Use related_order_code and related_item_code to associate a staging sales order with a different sales order that already exists in Incent. The related sales order may exist in a different batch and period. |
|
description | string | (Optional) Can store notes or other information regarding the sales order. |
|
Custom_Fields | varies | (Optional) Incent allows compensation administrators to add custom string, numeric, and date columns to sales orders. The column labels given by the business user in Incent’s UI should be present in the staging.order_item table. If they are not, please contact Xactly’s tech support team. They can work with you to make the custom column labels visible. The sync must be performed by Xactly personnel until further notice. |
xactly.xc_order_stage.Custom_Fields |
staging.order_item_assignment – (Required) Use this table to assign sales orders to specific employees. Generally, employees assigned to a sales order receive commission or other compensation for their involvement in closing a given sales order. Behavior is controlled by your implementation’s Incent rules and business requirements. Every staging.order_item row must have a least one order_item_assignment . Insert one row for each distinct employee assignment to a given order_code anditem_code . |
|||
Column Name | Data Type | Description | xactly Target Table |
---|---|---|---|
order_code | string | (Required) Refer to staging.order_item |
|
item_code | string | (Required) Refer to staging.order_item |
|
employee_id | string | (Required) Must correspond to a a valid xactly.xc_participant.employee_id value. |
xactly.xc_order_stage_asgnmt.participant_id |
split_amount_pct | decimal | (Required) Set to a decimal or integer value between 0-100. Sometimes used in Incent compensation rules to determine the percentage of a sales order that the listed payee is qualified to receive. | xactly.xc_order_stage_asgnmt.split_amount_pct |
Examples
incent upload orders;
Related Commands