Hi everyone,

I’m having issues with my online shop, I need some help calculating the total commission for contributors based on existing sales data.

Here’s the situation:

Data Structure (basics - there are more items in each):

  • Line Items: Contains fields for Product, Total, and Order Completed (yes/no).
  • Contributors: Contains a list of Product Contributions.
  • Product Contributions: Contains fields for Product, Contributor, and Commission %.

Goal: I want to show the total commission a contributor has made for all the products they have contributed to, based on the sales that have already been completed.

Challenges:

  1. I want to avoid creating a new data type if possible, but I’m open to it if necessary.
  2. If I create a new data type to store commission amounts, I need a way to add the existing sales data to this new data type so that I can calculate and display the total commission for each contributor.

Current Implementation: I am able to show the total of a contributor’s sales for a specific product within a repeating group, but not for all the products they contributed to. Here is how I’m showing the total for a specific product:

Total Commission earned for this product for the Period Selected:
Search for Order Line Items:each item’s total:sum * Parent group’s Product Contributions’s Commission %:formatted as R1,028.58


image

how can I Calculate the total commission for each contributor based on existing sales data?

Any help or suggestions would be greatly appreciated!

Thanks in advance!

It shouldn’t be very hard. If the database structure well, are online for a call, i maybe be able to help.