dbTalk Databases Forums  

How to make lookupcube work with Linkmember function in calculated measure

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


Discuss How to make lookupcube work with Linkmember function in calculated measure in the microsoft.public.sqlserver.olap forum.



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

Default How to make lookupcube work with Linkmember function in calculated measure - 12-06-2005 , 09:55 AM






Cube [Cube1] has dimensions:
[Reporting Currency]
[Date]

Cube [CubeRate] has dimensions:
[Currency]
[Date]
and measure [Rate]"

[Date] is shared dimension between [Cube1] and [CubeRate], while
[Reporting Currency]
and [Currency] has the same date key.

What to is to define a calculated member in [Cube1] to get [Rate].
(Even I know there is intelligent way to get currency conversion in
SSAS2005, we decide to use separate cube to save the FX rate as
separated cube from product requirement)

////////STATEMENT ONE WORKS!
LOOKUPCUBE ("[CubeRate]", "([Measures].[Rate],
[date].[date].&[2005-11-30],
LINKMEMEBR([Reporting Currency].[Currency].&[CAD],
[Currency].[Currency]) " )

//////// STATEMENT TWO DOESN'T WORK!
LOOKUPCUBE ("[CubeRate]", "([Measures].[Rate],
[date].[date].&[2005-11-30],
LINKMEMEBR(" + [Reporting Currency].[CurrentMember]. UniqueName +
",
[Currency].[Currency]) " )

In run time, [Reporting Currency].[CurrentMember].UniqueName is
[Reporting Currency].[Currency].&[CAD]

The question is why STATEMENT TWO DOESN'T WORK, while the STATEMENT
ONE works? Can anyone please help me to figure out the reason?


Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: How to make lookupcube work with Linkmember function in calculated measure - 12-06-2005 , 06:24 PM






Based on a similar Foodmart sample, this syntax works:

Quote:
LOOKUPCUBE("[CubeRate]",
"([Measures].[Rate],[date].[date].&[2005-11-30],LINKMEMBER("
+ [Reporting Currency].CurrentMember.UniqueName
+ ",[Currency].[Currency]))")
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


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.