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

- 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).

- Click on the Save Data Action > Save.

- 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.

- Select the Add Advanced Formulas Step icon.

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

- In the Target select All.

- In the Target Scope dialg box select + Add.

- Select Accounts.

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

- Select OK again.

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

- Select Source Scope.

- In Source select All.

- Click +Add

- Click Accounts

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

- Select OK again.

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

- In the second Source select All.

- Select + Add.

- Select Accounts.

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

- Click + Add.

- Choose Products from the dropdown.

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

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

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

- Select the x.

- Your Data Action should now look like this:

- 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.

- Select the Script tab.

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

- On the next line copy and paste the following comment:

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

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

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

- Select Data Actions in the main menu. Then select the Create Data Action tile.

- 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).

- Click on the Save Data Action > Save.

- 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.

- Select the Add Advanced Formulas Step icon.

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

- In the Target select All.

- In the Target Scope dialg box select + Add.

- Select Accounts.

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

- Select OK again.

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

- Select Source Scope.

- In Source select All.

- Click +Add

- Click Accounts

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

- Select OK again.

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

- In the second Source select All.

- Select + Add.

- Select Accounts.

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

- Click + Add.

- Choose Products from the dropdown.

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

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

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

- Select the x.

- Your Data Action should now look like this:

- 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.

- Select the Script tab.

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

- On the next line copy and paste the following comment:

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

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

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