Build Data Action

Objective

After completing this lesson, you will be able to build a Data Action.
  1. Select Data Actions in the main menu. Then select the Create Data Action tile.

  1. Enter Admin_DA_Rebates for the Name and Description. Then under Default Settings, in the Default Model drop-down, select PnL_Admin (or the model you copied in the previous section - PnL_CH3 for Data Actions Module).

  1. Click on the Save Data Action > Save.

  1. The Name and Description will already be populated with what was entered in the previous steps, so you can just select the Save button to Save.

  1. Select the Add Advanced Formulas Step icon.

  1. Enter Calculate Rebates for the formula Name and Description. Then under Variable select the + icon then Calculation.

  1. In the Target select All.

  1. In the Target Scope dialg box select + Add.

  1. Select Accounts.

  1. As shown in the screenshot, drill down through the members list and select PL011 Rebates. Then select OK.

  1. Select OK again.

  1. We will now set the Source Scope. Select the + icon within Expression.

  1. Select Source Scope.

  1. In Source select All.

  1. Click +Add

  1. Click Accounts

  1. As shown in image below, drill down through the members list and select PL010 Product Sales. Then select OK.

  1. Select OK again.

  1. Select the + icon to the right of the Source then select Source Scope.

  1. In the second Source select All.

  1. Select + Add.

  1. Select Accounts.

  1. As shown in screenshot below, select KP003 Rebate %. Then select OK.

  1. Click + Add.

  1. Choose Products from the dropdown.

  1. Expand APL and choose # Unassigned from the list of options, then click OK.

  1. In the Source Scope window, you can now click OK to close it.

  1. Click on the operator between the two Source Scopes to change it from an addition (+) operator to a multiplication (x) operator.

  1. Select the x.

  1. Your Data Action should now look like this:

  1. To save your Data Action select the Save icon > Save.

Optional exercise - Create an AI generated script

Another feature that is available when creating Data Actions is the embedded AI functionality, to automatically create your script with the click of a button.

  1. Select the Script tab.

  1. Copy and paste the following comment into the editor to highlight the fact that it is an AI generated:

//AI generated script

  1. On the next line copy and paste the following comment:

// calculate rebate = product sales * rebate%

  1. Highlight the whole comment line and the Generate Script button will become active. Click on Generate Script.

  1. Wait a moment for the AI to generate the script for you.

  1. You will see the script has been generated and you have the option to Accept or Reject what the AI has created.

Note

The AI script is the same as the script you generated from using the

Important❗

If you are having any issues with AI script generation, it may be due to the incomplete indexing of the model. When you get the below popup, your model is ready to use the Generative AI feature.
  1. Select Data Actions in the main menu. Then select the Create Data Action tile.

  1. Enter Admin_DA_Rebates for the Name and Description. Then under Default Settings, in the Default Model drop-down, select PnL_Admin (or the model you copied in the previous section - PnL_CH3 for Data Actions Module).

  1. Click on the Save Data Action > Save.

  1. The Name and Description will already be populated with what was entered in the previous steps, so you can just select the Save button to Save.

  1. Select the Add Advanced Formulas Step icon.

  1. Enter Calculate Rebates for the formula Name and Description. Then under Variable select the + icon then Calculation.

  1. In the Target select All.

  1. In the Target Scope dialg box select + Add.

  1. Select Accounts.

  1. As shown in the screenshot, drill down through the members list and select PL011 Rebates. Then select OK.

  1. Select OK again.

  1. We will now set the Source Scope. Select the + icon within Expression.

  1. Select Source Scope.

  1. In Source select All.

  1. Click +Add

  1. Click Accounts

  1. As shown in image below, drill down through the members list and select PL010 Product Sales. Then select OK.

  1. Select OK again.

  1. Select the + icon to the right of the Source then select Source Scope.

  1. In the second Source select All.

  1. Select + Add.

  1. Select Accounts.

  1. As shown in screenshot below, select KP003 Rebate %. Then select OK.

  1. Click + Add.

  1. Choose Products from the dropdown.

  1. Expand APL and choose # Unassigned from the list of options, then click OK.

  1. In the Source Scope window, you can now click OK to close it.

  1. Click on the operator between the two Source Scopes to change it from an addition (+) operator to a multiplication (x) operator.

  1. Select the x.

  1. Your Data Action should now look like this:

  1. To save your Data Action select the Save icon > Save.

Optional exercise - Create an AI generated script

Another feature that is available when creating Data Actions is the embedded AI functionality, to automatically create your script with the click of a button.

  1. Select the Script tab.

  1. Copy and paste the following comment into the editor to highlight the fact that it is an AI generated:

//AI generated script

  1. On the next line copy and paste the following comment:

// calculate rebate = product sales * rebate%

  1. Highlight the whole comment line and the Generate Script button will become active. Click on Generate Script.

  1. Wait a moment for the AI to generate the script for you.

  1. You will see the script has been generated and you have the option to Accept or Reject what the AI has created.

Note

The AI script is the same as the script you generated from using the

Important❗

If you are having any issues with AI script generation, it may be due to the incomplete indexing of the model. When you get the below popup, your model is ready to use the Generative AI feature.