I have a fact table with a numeric value stored in the currency that
the related transaction was made in, for example:
Fact Table
Period Amount Currency
------ ------ --------
row1 Jan 1 98.76 USD
row2 Jan 1 123.45 EUR
row3 Jan 1 234.56 CAD
row4 Jan 1 345.67 GBP
I need to be able to represent these values in their GBP equivalent,
based on a table that stores a set of rates for all the above
currencies at a point in time:
Rate Table
Rate Type Rate Desc Curr Rate Value
--------- --------- ---- ----------
row1 Monthly Jan 2003 GBP 1.000
row2 Monthly Jan 2003 USD 1.332
row3 Monthly Jan 2003 EUR 1.456
row4 Monthly Jan 2003 CAD 2.180
row5 Annual Jan 2003 GBP 1.000
row6 Annual Jan 2003 USD 1.321
row7 Annual Jan 2003 EUR 1.324
row8 Annual Jan 2003 CAD 2.210
My objective is to not store the combinations, but rather have the
user select the Rate Type as a dimension, the Rate Desc as a
dimension, display the currency and have as a calculated member the
Amount measure on the fact table divided by the relevant Rate Value
from the Rate dimension.
I have set up a calculated member on the measures dimension to do this
but the MDX query is not valid, I presume because I am trying to use a
dimensional attribute in a numeric calculation with a measure..?
Alternatively, I created a Rate cube and then joined this to the
original cube (as a virtual cube) but cannot prevent the aggergation
of the Rate Value, i.e. GBP rate value of 1.000 is summed
unnecessarily.
Does anyone have any thoughts on what I might be doing wrong/hints for
solving this dilemma using MDX?
All comments gratefully received.