dbTalk Databases Forums  

MDX LookUpCube function

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


Discuss MDX LookUpCube function in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bj?rn Tingstadengen
 
Posts: n/a

Default MDX LookUpCube function - 06-23-2005 , 02:34 AM






The LookUpcubeb need a MDX statemement as the reference to the cells
in the cube I want to get data from. This is OK if I need to get just
one value, however do anyone have an example of using this function
more dynamic across several dimensions.

See below - which I don't think is a nice example:

IIf([Period].CurrentMember.Name = "Jan",
LookupCube("Portefolio", "([Scenario].[Actual],[Period].[Jan])"),
IIf([Period].CurrentMember.Name = "Feb",
LookupCube("Portefolio", "[Scenario].[Actual],[Period].[Feb])"),
IIf([Periode].CurrentMember.Name = "Mar",
LookupCube("Portefolio", "([Scenario].[Actual],[Period].[Mar])"),
.......

Reply With Quote
  #2  
Old   
Chris Webb
 
Posts: n/a

Default RE: MDX LookUpCube function - 06-23-2005 , 03:35 AM






Hi Bjorn,

How's this (on Foodmart 2000)?

WITH MEMBER MEASURES.DEMO AS 'LOOKUPCUBE("WAREHOUSE", "([Measures].[Store
Invoice], " + TIME.CURRENTMEMBER.UNIQUENAME + ")")'
SELECT {MEASURES.[UNIT SALES], MEASURES.DEMO} ON 0,
TIME.MEMBERS ON 1
FROM SALES

I don't recommend using LookUpCube though, unless you absolutely have to -
it can cause query performance problems. Using a virtual cube instead is a
much better idea.

Regards,

Chris


--
Blog at:
http://spaces.msn.com/members/cwebbbi/


"Bj?rn Tingstadengen" wrote:

Quote:
The LookUpcubeb need a MDX statemement as the reference to the cells
in the cube I want to get data from. This is OK if I need to get just
one value, however do anyone have an example of using this function
more dynamic across several dimensions.

See below - which I don't think is a nice example:

IIf([Period].CurrentMember.Name = "Jan",
LookupCube("Portefolio", "([Scenario].[Actual],[Period].[Jan])"),
IIf([Period].CurrentMember.Name = "Feb",
LookupCube("Portefolio", "[Scenario].[Actual],[Period].[Feb])"),
IIf([Periode].CurrentMember.Name = "Mar",
LookupCube("Portefolio", "([Scenario].[Actual],[Period].[Mar])"),
.......


Reply With Quote
  #3  
Old   
Bj?rn Tingstadengen
 
Posts: n/a

Default Re: MDX LookUpCube function - 06-27-2005 , 04:49 AM



Many thanks - It worked. I also tried using virtual cubes, but there
was no significant difference in the query time.

RE
BT


"=?Utf-8?B?Q2hyaXMgV2ViYg==?=" <OnlyForPostingToNewsgroups (AT) hotmail (DOT) com> wrote

Quote:
Hi Bjorn,

How's this (on Foodmart 2000)?

WITH MEMBER MEASURES.DEMO AS 'LOOKUPCUBE("WAREHOUSE", "([Measures].[Store
Invoice], " + TIME.CURRENTMEMBER.UNIQUENAME + ")")'
SELECT {MEASURES.[UNIT SALES], MEASURES.DEMO} ON 0,
TIME.MEMBERS ON 1
FROM SALES

I don't recommend using LookUpCube though, unless you absolutely have to -
it can cause query performance problems. Using a virtual cube instead is a
much better idea.

Regards,

Chris


--
Blog at:
http://spaces.msn.com/members/cwebbbi/


"Bj?rn Tingstadengen" wrote:

The LookUpcubeb need a MDX statemement as the reference to the cells
in the cube I want to get data from. This is OK if I need to get just
one value, however do anyone have an example of using this function
more dynamic across several dimensions.

See below - which I don't think is a nice example:

IIf([Period].CurrentMember.Name = "Jan",
LookupCube("Portefolio", "([Scenario].[Actual],[Period].[Jan])"),
IIf([Period].CurrentMember.Name = "Feb",
LookupCube("Portefolio", "[Scenario].[Actual],[Period].[Feb])"),
IIf([Periode].CurrentMember.Name = "Mar",
LookupCube("Portefolio", "([Scenario].[Actual],[Period].[Mar])"),
.......


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.