The INCENT CALCULATE command enables you to run compensation-plan calculations within Incent. The command can calculate through just credits, just incentives, or both credits and incentives.
NOTE: These exercises assume the order batches you wish to calculate already exist in Incent in the Jan-2016 period.
INCENT CALCULATE Syntax
To run calculations in Incent, use:
incent calculate comp_rule_type (BatchNames=( list_of_batch_names );
Where comp_rule_type, when specified, is either credits or incentives. When omitted, both credits and incentives are included.
And where list_of_batch_names is an expression that filters to the batches to calculate.
IMPORTANT: Before you run INCENT CALCULATE, it is a best practice to reset any previously calculated results with INCENT RESET first.
Calculate Credits
We’ll start the exercise by ensuring our Incent credential is set:
1 SQL> incent credential test;
Next we’ll reset any previous credit calculations:
1 SQL> incent synchronous reset credits (BatchNames=(select distinct batch_name
from xactly.xc_user_batch bat
join xactly.xc_period per on per.period_id = bat.period_id
where per.name = ‘JAN-2016’));
NOTE: The BatchNames parameter is dynamically populated from the list of distinct batches found in the JAN-2016 period in Incent. You might need to choose a different period or set of batches.
And now we’ll run those credit calculations:
1 SQL> incent synchronous calculate credits (BatchNames=(select distinct batch_name
from xactly.xc_user_batch bat
join xactly.xc_period per on per.period_id = bat.period_id
where per.name = ‘JAN-2016’));
Calculate Incentives
To reset and calculate incentives, we simply replace credits with incentives in the expressions.
Reset incentives:
1 SQL> incent synchronous reset incentives (BatchNames=(select distinct batch_name
from xactly.xc_user_batch bat
join xactly.xc_period per on per.period_id = bat.period_id
where per.name = ‘JAN-2016’));
Calculate incentives:
1 SQL> incent synchronous calculate incentives (BatchNames=(select distinct batch_name
from xactly.xc_user_batch bat
join xactly.xc_period per on per.period_id = bat.period_id
where per.name = ‘JAN-2016’));
Calculate Credits and Incentives
To calculate both credits and incentives, remove the transaction_object from the expression.
Reset incentives and credits:
1 SQL> incent synchronous reset (BatchNames=(select distinct batch_name
from xactly.xc_user_batch bat
join xactly.xc_period per on per.period_id = bat.period_id
where per.name = ‘JAN-2016’));
NOTE: Incent resets the incentives first, then the credits.
Calculate credits and incentives:
1 SQL> incent synchronous calculate (BatchNames=(select distinct batch_name
from xactly.xc_user_batch bat
join xactly.xc_period per on per.period_id = bat.period_id
where per.name = ‘JAN-2016’));
NOTE: Incent calculates the credits first, then the incentives.
You did it!
Reset Incent Calculations, Purge Orders
In many situations, it is a best practice to clean up your existing Incent data prior to uploading orders from staging or running Incent calculations. For example, in many customer configurations, new data is loaded and calculations are run on a regular basis, weekly, or even daily. Before processing the new data, it is important to purge the old each time.
To do this, we’ll learn how to reset Incent calculations, delete processed and staged orders, and purge order batches from Incent.
NOTE: This section repeats many of the INCENT command operations found in previous exercises, but were deemed important enough to cover again to help you understand different ways to manipulate data in Incent and run Incent calculations.
Reset Calculation Results
The INCENT RESET command enables you to reset calculation results within Incent. The command can reset just credits, just incentives, or both credits and incentives.
INCENT RESET Syntax
To reset previously calculated results, use:
incent reset comp_rule_type (BatchNames=( list_of_batch_names );
Where comperule_type, when specified, is either credits or incentives. When omitted, both credits and incentives are reset.
And where list_of_batch_names is an expression that filters to the batches to reset to the “pre” state.
Reset Credits
Start by ensuring the Incent credential is set:
1 SQL> incent credential test;
Now reset previous credit calculations:
1 SQL> incent synchronous reset credits (BatchNames=(select distinct batch_name
from xactly.xc_user_batch bat
join xactly.xc_period per on per.period_id = bat.period_id
where per.name = ‘JAN-2016’));
NOTE: The BatchNames parameter is dynamically populated from the list of distinct batches found in the JAN-2016 period in Incent. You might need to choose a different period.
Reset Incentives
To reset incentives, replace credits with incentives in the expression:
1 SQL> incent synchronous reset incentives (BatchNames=(select distinct batch_name
from xactly.xc_user_batch bat
join xactly.xc_period per on per.period_id = bat.period_id
where per.name = ‘JAN-2016’));
Reset Incentives and Credits
To reset both incentives and credits, remove the comp_rule_type from the expression:
1 SQL> incent synchronous reset (BatchNames=(select distinct batch_name
from xactly.xc_user_batch bat
join xactly.xc_period per on per.period_id = bat.period_id
where per.name = ‘JAN-2016’));
NOTE: Incent resets the incentives first, then the credits.
Delete Orders
Before running calculations on new orders, it is usually necessary to delete the existing orders first.
Using INCENT DELETE, you can delete processed orders, or both processed and staged orders.
NOTE: INCENT DELETE always resets incentives and then credits before deleting orders.
INCENT DELETE Syntax
To delete processed or processed and staged orders, use:
incent delete orders order_type (BatchNames=( list_of_batch_names );
Where order_type is either processed or staged. If processed, only processed orders are deleted and existing staged orders remain. If staged, both processed and staged orders are deleted.
And where list_of_batch_names is an expression that filters to the batches to be deleted.
Delete Processed Orders
Start by ensuring the Incent credential is set:
1 SQL> incent credential test;
Now delete the processed orders:
1 SQL> incent delete orders processed (BatchNames=(select distinct batch_name
from xactly.xc_user_batch bat
join xactly.xc_period per on per.period_id = bat.period_id
where per.name = ‘JAN-2016’));
Existing staged orders are unaffected.
NOTE: The BatchNames parameter is dynamically populated from the list of distinct batches found in the JAN-2016 period in Incent. You might need to choose a different period.
Delete Processed & Staged Orders
To delete both processed and staged orders, use staged for order_type:
1 SQL> incent delete orders staged (BatchNames=(select distinct batch_name
from xactly.xc_user_batch bat
join xactly.xc_period per on per.period_id = bat.period_id
where per.name = ‘JAN-2016’));
Purge Order Batches
To remove batches of sales orders from Incent completely, sometimes it is necessary to purge your orders from the system.
INCENT PURGE deletes processed orders, then staged orders, and finally removes the batch names from the xactly.xc_user_batch file.
NOTE: INCENT PURGE always resets incentives and then credits before deleting orders and removing the batch names.
INCENT PURGE Syntax
To delete all orders and clean the xactly.xc_user_batch file, use:
incent purge orders (BatchNames=( list_of_batch_names );
Where list_of_batch_names is an expression that filters to the batches and batch names to be deleted.
Purge Orders & Batch File
In our last example for this section, we issue a command that resets incentives, then credits, then deletes the processed orders, then the staged orders, and finally, removes the batch names from the batch file:
1 SQL> incent purge orders (BatchNames=(select distinct batch_name
from xactly.xc_user_batch bat
join xactly.xc_period per on per.period_id = bat.period_id
where per.name = ‘JAN-2016’));
NOTE: The BatchNames parameter is dynamically populated from the list of distinct batches found in the JAN-2016 period in Incent. You might need to choose a different period.
That’s it! Your data is scrubbed and you’re ready to upload new sales order data and run new Incent calculations.