Theoretical question -
07-01-2005
, 02:02 PM
I just wonder is it possible to create OLAP decision for task like this:
Suppose we have fact table ROBBERY:
RobberyID integer
BandID integer
Stolen money
And parent-child dimentionBAND (Pirate – Boss) linked by BandID to ROBBERY
table:
BandID integer
Boss integer
Pirate integer
PirateName string
Share% DECIMAL(10,4)
A band has Pirate Contract – records in dimension BAND which define share of
each pirate in case of successful robbery
( cap – 25%, ……John – 3%, ….. boy 0.5% ).
777 / null/ 1/ cap/ 25
777 /1 / 55/ John/ 3
Let say band is lucky and we got record in ROBBERY table:
123123 / 777 / $1000000
Task is: how to split $1000000 and calculate each pirate share.
No taxes.
Thanks,
Tim. |