dbTalk Databases Forums  

PrevMember Question

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


Discuss PrevMember Question in the microsoft.public.sqlserver.olap forum.



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

Default PrevMember Question - 10-23-2006 , 07:42 PM






Hello, I am running into an issue where CurrentMember DOES NOT return all
members at the lowest level. Here's my dimension Hierarchy -->
[Week].[Week].[Week Name]

I want to have it return the following when I select [Week].[Week
Name].CurrentMember
Week of 09/04/2006
Week of 09/11/2006
Week of 09/18/2006

But it is returning at the ALL level
All

Once I can return all members using CurrentMember, I should be able to use
CurrentMember.PrevMember to return Total Revenue for the previous member,
same as Lag(1). If anyone can shed some light on how to return all members
at the lowest level using CurrentMember, I would truly appreciated! If
there's an alternate way of NOT using CurrentMember, please feel free to let
me know.

-Lawrence

Below is my current MDX not returning all members at the lowest level though.

WITH MEMBER [Measures].[Growth] AS
{ ([Week].[Week].CurrentMember.PrevMember, [Measures].[Total Revenue]) }
SELECT
[Measures].[Growth] ON COLUMNS
, nonempty( [Week].[Week].[Week Name].ALLMEMBERS ) ON ROWS
FROM [GMDSummary]

Reply With Quote
  #2  
Old   
yongli
 
Posts: n/a

Default RE: PrevMember Question - 10-23-2006 , 11:44 PM






replacing the column by [Measures].[Total Revenue], would you get all the
weeks then?
just want to make sure it has values on the week level.

"Lawrence" wrote:

Quote:
Hello, I am running into an issue where CurrentMember DOES NOT return all
members at the lowest level. Here's my dimension Hierarchy --
[Week].[Week].[Week Name]

I want to have it return the following when I select [Week].[Week
Name].CurrentMember
Week of 09/04/2006
Week of 09/11/2006
Week of 09/18/2006

But it is returning at the ALL level
All

Once I can return all members using CurrentMember, I should be able to use
CurrentMember.PrevMember to return Total Revenue for the previous member,
same as Lag(1). If anyone can shed some light on how to return all members
at the lowest level using CurrentMember, I would truly appreciated! If
there's an alternate way of NOT using CurrentMember, please feel free to let
me know.

-Lawrence

Below is my current MDX not returning all members at the lowest level though.

WITH MEMBER [Measures].[Growth] AS
{ ([Week].[Week].CurrentMember.PrevMember, [Measures].[Total Revenue]) }
SELECT
[Measures].[Growth] ON COLUMNS
, nonempty( [Week].[Week].[Week Name].ALLMEMBERS ) ON ROWS
FROM [GMDSummary]

Reply With Quote
  #3  
Old   
Lawrence
 
Posts: n/a

Default RE: PrevMember Question - 10-24-2006 , 12:04 AM



Yes. I would get all the week members with either [Week].[Week].[Week
Name].AllMembers or [Week].[Week Name].CurrentMember.Children

Could you explain why [Week].[Week Name].CurrentMember could not produce all
the weeks? I DO NOT think I can use Children and PrevMember at the same
time, so still trying to find out how to use CurrentMember.PrevMember...

Help is appreciated!
-Lawrence

"yongli" wrote:

Quote:
replacing the column by [Measures].[Total Revenue], would you get all the
weeks then?
just want to make sure it has values on the week level.

"Lawrence" wrote:

Hello, I am running into an issue where CurrentMember DOES NOT return all
members at the lowest level. Here's my dimension Hierarchy --
[Week].[Week].[Week Name]

I want to have it return the following when I select [Week].[Week
Name].CurrentMember
Week of 09/04/2006
Week of 09/11/2006
Week of 09/18/2006

But it is returning at the ALL level
All

Once I can return all members using CurrentMember, I should be able to use
CurrentMember.PrevMember to return Total Revenue for the previous member,
same as Lag(1). If anyone can shed some light on how to return all members
at the lowest level using CurrentMember, I would truly appreciated! If
there's an alternate way of NOT using CurrentMember, please feel free to let
me know.

-Lawrence

Below is my current MDX not returning all members at the lowest level though.

WITH MEMBER [Measures].[Growth] AS
{ ([Week].[Week].CurrentMember.PrevMember, [Measures].[Total Revenue]) }
SELECT
[Measures].[Growth] ON COLUMNS
, nonempty( [Week].[Week].[Week Name].ALLMEMBERS ) ON ROWS
FROM [GMDSummary]

Reply With Quote
  #4  
Old   
Ohjoo Kwon
 
Posts: n/a

Default Re: PrevMember Question - 10-24-2006 , 12:41 AM



If you want to return all members at the level of [Week Name],

[Week].[Week].[Week Name].Members is enough. Of course, it does not contain
All member and any other calcualted members at the level. If you use
AllMembers, it also contains All member and any other calcualted members at
the [Week Name] level.

And why [Week].[Week].CurrentMember could not produce all the weeks?

Here CurrentMember function returns only Current Member pointing to the
current cell in the cube. For example, if you look at cells within the Week
of 09/04/2006, it returns only the week member not all week members.

Ohjoo


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

Quote:
Yes. I would get all the week members with either [Week].[Week].[Week
Name].AllMembers or [Week].[Week Name].CurrentMember.Children

Could you explain why [Week].[Week Name].CurrentMember could not produce
all
the weeks? I DO NOT think I can use Children and PrevMember at the same
time, so still trying to find out how to use CurrentMember.PrevMember...

Help is appreciated!
-Lawrence

"yongli" wrote:

replacing the column by [Measures].[Total Revenue], would you get all the
weeks then?
just want to make sure it has values on the week level.

"Lawrence" wrote:

Hello, I am running into an issue where CurrentMember DOES NOT return
all
members at the lowest level. Here's my dimension Hierarchy --
[Week].[Week].[Week Name]

I want to have it return the following when I select [Week].[Week
Name].CurrentMember
Week of 09/04/2006
Week of 09/11/2006
Week of 09/18/2006

But it is returning at the ALL level
All

Once I can return all members using CurrentMember, I should be able to
use
CurrentMember.PrevMember to return Total Revenue for the previous
member,
same as Lag(1). If anyone can shed some light on how to return all
members
at the lowest level using CurrentMember, I would truly appreciated! If
there's an alternate way of NOT using CurrentMember, please feel free
to let
me know.

-Lawrence

Below is my current MDX not returning all members at the lowest level
though.

WITH MEMBER [Measures].[Growth] AS
{ ([Week].[Week].CurrentMember.PrevMember, [Measures].[Total
Revenue]) }
SELECT
[Measures].[Growth] ON COLUMNS
, nonempty( [Week].[Week].[Week Name].ALLMEMBERS ) ON ROWS
FROM [GMDSummary]



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.