dbTalk Databases Forums  

MDX for exchange rate calculation

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss MDX for exchange rate calculation in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
DaveK
 
Posts: n/a

Default MDX for exchange rate calculation - 11-24-2004 , 10:03 AM






Hi I'm really struggling to get exchange rates working in my cubes and I
wondered if anyone could help.

If I have a cube with a fact table called which contains something like:

Date Revenue Website
01 Nov 504.39 UK
01 Nov 794.43 US
02 Nov 596.49 UK
02 Nov 761.22 US

If I have a website dimension and a time dimension (days, month, quarter, or
days, week whatever) then that's fine. If I as for the 01 Nov revenue for UK
it will give me 504.39 and if I ask for US revenue on 01 Nov it will give me
US. However, if I ask for all 01 Nov revenue it can't sum due to differing
currencies. I want the website dimension to show the above (i.e. native
currency) until you go to the All Website level at which time I want the US
values to be affected by the exchange rate at the date of the revenue. I have
an exchange fact table like:

Date Currency ExchangeRage
01 Nov USD 1.8319
02 Nov USD 1.8319
03 Nov USD 1.8538
04 Nov USD 1.8545

I'm struggling to create the MDX which will get me:

01 Nov revenue for UK = 504.39 pounds
01 Nov revenue for US = 794.43 dollards
01 Nov revenue = 504.39 + (794.43/1.8319) = 938.05 (2dp)

I've tried creating an exchange rate cube and I've tried using LOOKUP cube
to reference it but I can't fathom the MDX. Any help greatly appreciated.


Reply With Quote
  #2  
Old   
Michael Vardinghus
 
Posts: n/a

Default Re: MDX for exchange rate calculation - 11-25-2004 , 04:03 AM






Tom has a currency conversion section in this article...at the bottom...

http://www.tomchester.net/articlesdo...atedcells.html


"DaveK" <DaveK (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi I'm really struggling to get exchange rates working in my cubes and I
wondered if anyone could help.

If I have a cube with a fact table called which contains something like:

Date Revenue Website
01 Nov 504.39 UK
01 Nov 794.43 US
02 Nov 596.49 UK
02 Nov 761.22 US

If I have a website dimension and a time dimension (days, month, quarter,
or
days, week whatever) then that's fine. If I as for the 01 Nov revenue for
UK
it will give me 504.39 and if I ask for US revenue on 01 Nov it will give
me
US. However, if I ask for all 01 Nov revenue it can't sum due to differing
currencies. I want the website dimension to show the above (i.e. native
currency) until you go to the All Website level at which time I want the
US
values to be affected by the exchange rate at the date of the revenue. I
have
an exchange fact table like:

Date Currency ExchangeRage
01 Nov USD 1.8319
02 Nov USD 1.8319
03 Nov USD 1.8538
04 Nov USD 1.8545

I'm struggling to create the MDX which will get me:

01 Nov revenue for UK = 504.39 pounds
01 Nov revenue for US = 794.43 dollards
01 Nov revenue = 504.39 + (794.43/1.8319) = 938.05 (2dp)

I've tried creating an exchange rate cube and I've tried using LOOKUP cube
to reference it but I can't fathom the MDX. Any help greatly appreciated.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.