dbTalk Databases Forums  

scope questions for SSAS 2005

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


Discuss scope questions for SSAS 2005 in the microsoft.public.sqlserver.olap forum.



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

Default scope questions for SSAS 2005 - 04-13-2006 , 10:55 AM






I am getting the following error:

"The lastchild expression expects a member expression for the #0
argument, a level expression was used"

while executing:


SCOPE (
[Time].[Time_LastFourYears].[Year].Members ,
[Activity].[Activity for Res and
MS].[Activity].&[InvDORF],[Measures].[Quantity]
);

THIS = [Time].[Time_LastFourYears].[year].lastchild;


END SCOPE;


In addition, I am wondering when this code is executed, at the cube
process time or at the query run time.

Thanks in advance,
Koni.

Reply With Quote
  #2  
Old   
Jéjé
 
Posts: n/a

Default Re: scope questions for SSAS 2005 - 04-13-2006 , 04:10 PM






try anything like:
THIS = ([Time].[Time_LastFourYears].[year].lastchild ,
[Measures].[Quantity]);


"Koni Kogan" <kkogan (AT) haiint (DOT) com> wrote

Quote:
I am getting the following error:

"The lastchild expression expects a member expression for the #0 argument,
a level expression was used"

while executing:


SCOPE (
[Time].[Time_LastFourYears].[Year].Members ,
[Activity].[Activity for Res and
MS].[Activity].&[InvDORF],[Measures].[Quantity]
);

THIS = [Time].[Time_LastFourYears].[year].lastchild;


END SCOPE;


In addition, I am wondering when this code is executed, at the cube
process time or at the query run time.

Thanks in advance,
Koni.



Reply With Quote
  #3  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: scope questions for SSAS 2005 - 04-16-2006 , 07:12 PM




[Time].[Time_LastFourYears].[year] - Is a reference to a level in the
dimension, the .LastChild function needs a member reference. I suspect
you might want something like:

[Time].[Time_LastFourYears].[year].CurrentMember.LastChild

Which would get you the last child of the current year member.

And with regard to your second question, I believe all MDX calculations
are currently executed at runtime.

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <ew3YpKxXGHA.3684 (AT) TK2MSFTNGP05 (DOT) phx.gbl>, kkogan (AT) haiint (DOT) com
says...
Quote:
I am getting the following error:

"The lastchild expression expects a member expression for the #0
argument, a level expression was used"

while executing:


SCOPE (
[Time].[Time_LastFourYears].[Year].Members ,
[Activity].[Activity for Res and
MS].[Activity].&[InvDORF],[Measures].[Quantity]
);

THIS = [Time].[Time_LastFourYears].[year].lastchild;


END SCOPE;


In addition, I am wondering when this code is executed, at the cube
process time or at the query run time.

Thanks in advance,
Koni.


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.