Quantcast
Channel: SQLServerCentral » Data Warehousing » Analysis Services » Latest topics
Viewing all articles
Browse latest Browse all 1341

Values in refence currency calculation - Performance problem

$
0
0
[b]Background:[/b] I have a fact table with transactional data from a sales system which contains values in different currencies. I have only one reference currency in the reports. The user wants to be able to view the values in the reference currency but with the exchange rate of the selected date.I have a table with a row per currency/date combination and the exchange rate to the reference currency.Records in the fact table also have a reference to the currency and a date.[b]Initial approach:[/b]I created 2 measure groups, one base on the transactional data from the fact table and one with the exchange rates.Both measure groups have in common the currency and date dimensions. A many to many relationship makes no sense because I have only one reference currency.I create a calculated member to aggregate the data up to a selected date, something like this:[code="sql"]with member [Measures].[Net Sales Local Currency] AS ( Aggregate({null:[Time Hierarchy].[Date].CurrentMenber}, [Measures].[Net Sales LC]))member [Measures].[Exchange Rate to Reference] AS (([Time Hierarchy].[Date].CurrentMenber, [Measures].[Exchange Rate]))member [Measures].[Net Sales Refence Currency] AS (SUM([Currencies].[ISO Code].[ISO Code], [Measures].[Net Sales Local Currency]/[Measures].[Exchange Rate to Reference]))[/code][b]Results:[/b]When I select only a date member, let's say the 01.01.2014 I get a result within a second. If a put 2 dates in the select the result takes about 10 minutes. I suppose I am making something wrong in my calculated members that cause this peformance penalty.Could you please help me to debug my MDX code?Any comments would be highly appreciated.Kind Regards,Paul

Viewing all articles
Browse latest Browse all 1341

Trending Articles