Inventory Data Mart / Cube problem -
12-01-2003
, 03:18 AM
Hi group!
Im trying to build an inventory Mart / Cube.
My source data looks something like:
TransActionDate, TransactionTime, ProdId, InventoryBalance, QTY_Added,
QTY_Removed .....
The InventoryBalance is the number of items of ProdId after the transaction
has run
In my Mart I have a time dimension where the lowest level is Day.
In a day, multiple transactions may exist in my source data for the same
prodid.
Does anyone have any clever SQL that retrieves the sum of QTY_Added and
QTY_Removed and then the InventoryBalance that occured LAST that day (ie
max(transactiontime) for that day) so that i get one row per day for any
prodid?
Also im having trouble with the InventoryBalance Meaure. This is not an
additive measure, how should i handle this in aggregations?
Any help greatly appreciated!
Cheers,
Peter |