I want to present sales per product but be able to deduct fees. However, the fees are given per order, and have to be split among the products in that particular order. How can I achieve this? I have a feeling there is an easy way to do this.
Thanks, that seems to work! And seeing that aggr function gave me the even better idea to create an OrderInfo table in the load script, using GROUP BY, which will basically calculate the total count of products and total value of each order. With those numbers on hand, it is easy to split the fee among the products later on.