dbTalk Databases Forums  

Following Siblings

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


Discuss Following Siblings in the microsoft.public.sqlserver.olap forum.



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

Default Following Siblings - 07-15-2005 , 09:04 AM






Can anyone offer some advice on creating a calculated member representing
the sum of 'Following Siblings' of a measure, based on the current member of
a dimension?

I am trying to accomplish this with the following statement to no avail.

member [Measures].[CalcMeasure] as 'Sum(Filter({[Measures].[TheMeasure]},
[Dimension] <=
[Dimension].CurrentMember), [Measures].[TheMeasure])', format = '#.##'

Select
NON EMPTY {[Measures].[TheMeasure], [Measures].[CalcMeasure]} on axis(0),
NON EMPTY {[Dimension].[Level].members} on axis(1)

tx,
Tim



Reply With Quote
  #2  
Old   
SQL McOLAP
 
Posts: n/a

Default RE: Following Siblings - 07-15-2005 , 09:23 AM






Are you trying to do following siblings, or previous siblings? It kind of
looks like you're trying to do previous siblings based on what I see in your
post.

If you want to get previous siblings, something like:

with member [measures].[mycalc] as 'SUM({[Education
Level].CurrentMember.FirstSibling : [Education
Level].CurrentMember},[measures].[store sales])'
select {[measures].[store sales],[measures].[mycalc]} on columns,
{[Education Level].[All Education Level].children} on rows
from sales

If you want following siblings:

with member [measures].[mycalc] as 'SUM({[Education Level].CurrentMember :
[Education Level].LastSibling},[measures].[store sales])'
select {[measures].[store sales],[measures].[mycalc]} on columns,
{[Education Level].[All Education Level].children} on rows
from sales


Keep in mind, in the above queries, currentmember is the anchor point. If
you don't want to include current member in what you're doing, you can use
CurrentMember.PrevMember or CurrentMember.NextMember depending upon which of
the two you're trying to do.

Good luck.

- Phil


"Tim Chapla" wrote:

Quote:
Can anyone offer some advice on creating a calculated member representing
the sum of 'Following Siblings' of a measure, based on the current member of
a dimension?

I am trying to accomplish this with the following statement to no avail.

member [Measures].[CalcMeasure] as 'Sum(Filter({[Measures].[TheMeasure]},
[Dimension] <=
[Dimension].CurrentMember), [Measures].[TheMeasure])', format = '#.##'

Select
NON EMPTY {[Measures].[TheMeasure], [Measures].[CalcMeasure]} on axis(0),
NON EMPTY {[Dimension].[Level].members} on axis(1)

tx,
Tim




Reply With Quote
  #3  
Old   
Tim Chapla
 
Posts: n/a

Default Re: Following Siblings - 07-15-2005 , 09:57 AM



AH!!! I've seen the syntax before, just escaped me.

Thank you!

"SQL McOLAP" <SQLMcOLAP (AT) discussions (DOT) microsoft.com> wrote

Quote:
Are you trying to do following siblings, or previous siblings? It kind of
looks like you're trying to do previous siblings based on what I see in
your
post.

If you want to get previous siblings, something like:

with member [measures].[mycalc] as 'SUM({[Education
Level].CurrentMember.FirstSibling : [Education
Level].CurrentMember},[measures].[store sales])'
select {[measures].[store sales],[measures].[mycalc]} on columns,
{[Education Level].[All Education Level].children} on rows
from sales

If you want following siblings:

with member [measures].[mycalc] as 'SUM({[Education Level].CurrentMember :
[Education Level].LastSibling},[measures].[store sales])'
select {[measures].[store sales],[measures].[mycalc]} on columns,
{[Education Level].[All Education Level].children} on rows
from sales


Keep in mind, in the above queries, currentmember is the anchor point. If
you don't want to include current member in what you're doing, you can use
CurrentMember.PrevMember or CurrentMember.NextMember depending upon which
of
the two you're trying to do.

Good luck.

- Phil


"Tim Chapla" wrote:

Can anyone offer some advice on creating a calculated member representing
the sum of 'Following Siblings' of a measure, based on the current member
of
a dimension?

I am trying to accomplish this with the following statement to no avail.

member [Measures].[CalcMeasure] as 'Sum(Filter({[Measures].[TheMeasure]},
[Dimension] <=
[Dimension].CurrentMember), [Measures].[TheMeasure])', format = '#.##'

Select
NON EMPTY {[Measures].[TheMeasure], [Measures].[CalcMeasure]} on axis(0),
NON EMPTY {[Dimension].[Level].members} on axis(1)

tx,
Tim






Reply With Quote
  #4  
Old   
Tim Chapla
 
Posts: n/a

Default Re: Following Siblings - 07-15-2005 , 10:26 AM



Can I restrict the members of the dimension to the slices of my where
clause? I am getting calculated members for data that does not return in
the query.

ScaleScores_Reading Density Fx
4
4
2 2 4
1 2 2
0

Here is my query:

With
member [Measures].[Fx] as
'Sum({[ScaleScores_Reading].CurrentMember:[ScaleScores_Reading].LastSibling},
[Measures].[Density])', format = '#.##'

Select
{[Measures].[Density], [Measures].[Fx]} on axis(0),
NON EMPTY {[ScaleScores_Reading].[Score Value].members} on axis(1)

From WKCE_SS

where (
[Grade Level].[Grade Level Name].[Grade 04],
[Year].[2004-05],
[District_School].[All District_School].[1]
)


"SQL McOLAP" <SQLMcOLAP (AT) discussions (DOT) microsoft.com> wrote

Quote:
Are you trying to do following siblings, or previous siblings? It kind of
looks like you're trying to do previous siblings based on what I see in
your
post.

If you want to get previous siblings, something like:

with member [measures].[mycalc] as 'SUM({[Education
Level].CurrentMember.FirstSibling : [Education
Level].CurrentMember},[measures].[store sales])'
select {[measures].[store sales],[measures].[mycalc]} on columns,
{[Education Level].[All Education Level].children} on rows
from sales

If you want following siblings:

with member [measures].[mycalc] as 'SUM({[Education Level].CurrentMember :
[Education Level].LastSibling},[measures].[store sales])'
select {[measures].[store sales],[measures].[mycalc]} on columns,
{[Education Level].[All Education Level].children} on rows
from sales


Keep in mind, in the above queries, currentmember is the anchor point. If
you don't want to include current member in what you're doing, you can use
CurrentMember.PrevMember or CurrentMember.NextMember depending upon which
of
the two you're trying to do.

Good luck.

- Phil


"Tim Chapla" wrote:

Can anyone offer some advice on creating a calculated member representing
the sum of 'Following Siblings' of a measure, based on the current member
of
a dimension?

I am trying to accomplish this with the following statement to no avail.

member [Measures].[CalcMeasure] as 'Sum(Filter({[Measures].[TheMeasure]},
[Dimension] <=
[Dimension].CurrentMember), [Measures].[TheMeasure])', format = '#.##'

Select
NON EMPTY {[Measures].[TheMeasure], [Measures].[CalcMeasure]} on axis(0),
NON EMPTY {[Dimension].[Level].members} on axis(1)

tx,
Tim






Reply With Quote
  #5  
Old   
Raman Iyer [MS]
 
Posts: n/a

Default Re: Following Siblings - 07-15-2005 , 01:42 PM



[forwarding to a more appropriate newsgroup for this OLAP/MDX question]

--
-Raman Iyer
SQL Server Data Mining

"Tim Chapla" <tchapla (AT) nospam (DOT) turnleaf.com> wrote

Quote:
Can anyone offer some advice on creating a calculated member representing
the sum of 'Following Siblings' of a measure, based on the current member
of a dimension?

I am trying to accomplish this with the following statement to no avail.

member [Measures].[CalcMeasure] as 'Sum(Filter({[Measures].[TheMeasure]},
[Dimension].Properties("OrderByID") <=
[Dimension].CurrentMember.Properties("OrderByID")),
[Measures].[TheMeasure])', format = '#.##'

Select
NON EMPTY {[Measures].[TheMeasure], [Measures].[CalcMeasure]} on axis(0),
NON EMPTY {[Dimension].[Level].members} on axis(1)

tx,
Tim




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.