Cartesianjoin
Programmer
A salesrep has the ability to issue a discount associated with an entire order and not to a specific item on the order.
The discount is entered as a customer credit to the AR / billing system matched to the orderId # and is mapped to a salesrep discount type along with a comment reason.
For me to determine the exact profit and loss per order
I will summarize the entire sales details fact to the order# (a degenerate table) and have columns for discount amt, discount type, credit, credit type (fk) salesrep discount.
We can now determine if we made money on the sale or not.
Sales Summary fact is a rollup from sales combined with the discounts from the cash receipts fact and will look as follows.
Gross sales, gross profit (qty discounts are in the sales fact table calculated as part of cost, special discounts for line items are in the sales fact table as a # column and fk to discount dimension), discount amt, discount type(fk), credit amt , credit type (fk), salesrep discount amt,
.
We have the following dimensions around this fact:
Sales Rep (employee), customer /divisional(hierachicy), time, branch, (I may have a comment dimension)
Any thoughts.
The discount is entered as a customer credit to the AR / billing system matched to the orderId # and is mapped to a salesrep discount type along with a comment reason.
For me to determine the exact profit and loss per order
I will summarize the entire sales details fact to the order# (a degenerate table) and have columns for discount amt, discount type, credit, credit type (fk) salesrep discount.
We can now determine if we made money on the sale or not.
Sales Summary fact is a rollup from sales combined with the discounts from the cash receipts fact and will look as follows.
Gross sales, gross profit (qty discounts are in the sales fact table calculated as part of cost, special discounts for line items are in the sales fact table as a # column and fk to discount dimension), discount amt, discount type(fk), credit amt , credit type (fk), salesrep discount amt,
.
We have the following dimensions around this fact:
Sales Rep (employee), customer /divisional(hierachicy), time, branch, (I may have a comment dimension)
Any thoughts.