dbTalk Databases Forums  

Calculated Member - Current Member - Previous Member Madness

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


Discuss Calculated Member - Current Member - Previous Member Madness in the microsoft.public.sqlserver.olap forum.



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

Default Calculated Member - Current Member - Previous Member Madness - 07-13-2005 , 01:49 PM






I have a tricky one here.

Basically I have the following, 2 dimensional output

COL 1 COL 2
ROW 1 4 8
ROW 2 2 4
ROW 3 2 2

I am trying to find the syntax, or some workaround, for calculating COL 2,
which references COL 1(n) and itself, COL 2(n-1) to calculate:
COL 2(n) = COL 1(n) + COL 2(n-1)

I am trying to reference the PrevMember of COL 2 while generating COL 2.

I've tried generating a calculated member in MDX as such:
member [Measures].[COL2] as '[Measures].[COL1] +
[Measures].[COL2].CurrentMember.PrevMember', format = '#.##'

It just won't allow me to reference something I'm generating like this
on-the-fly. Makes sense. Is there any way to accomplish this with
calculated members, cells, anything?

I am using linear interpolation to estimate Percentile Ranks for Student
scores. The algorithm 'STARTS' here. Phew this is fun.

Any help would be greatly appreciated.

tx,
Tim



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

Default Re: Calculated Member - Current Member - Previous Member Madness - 07-13-2005 , 02:05 PM






I can also get a sum of all members below the current COL 1 member to
calculate COL 2.

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

Quote:
I have a tricky one here.

Basically I have the following, 2 dimensional output

COL 1 COL 2
ROW 1 4 8
ROW 2 2 4
ROW 3 2 2

I am trying to find the syntax, or some workaround, for calculating COL 2,
which references COL 1(n) and itself, COL 2(n-1) to calculate:
COL 2(n) = COL 1(n) + COL 2(n-1)

I am trying to reference the PrevMember of COL 2 while generating COL 2.

I've tried generating a calculated member in MDX as such:
member [Measures].[COL2] as '[Measures].[COL1] +
[Measures].[COL2].CurrentMember.PrevMember', format = '#.##'

It just won't allow me to reference something I'm generating like this
on-the-fly. Makes sense. Is there any way to accomplish this with
calculated members, cells, anything?

I am using linear interpolation to estimate Percentile Ranks for Student
scores. The algorithm 'STARTS' here. Phew this is fun.

Any help would be greatly appreciated.

tx,
Tim





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

Default Re: Calculated Member - Current Member - Previous Member Madness - 07-14-2005 , 08:07 AM



My latest attempt:

member [Measures].[COL 1] as 'Sum(Filter({[ROW DIMENSION]}, [ROW
DIMENSION].Properties("OrderByID") <= [ROW
DIMENSION].CurrentMember.Properties("OrderByID")), [Measures].[COL 1])',
format = '#.##'

The result is just giving me COL 1, rather than a Sum of all the COL 1
values. Can anyone help me find a way to filter on a property of a Row
member?

tx,
tim

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

Quote:
I can also get a sum of all members below the current COL 1 member to
calculate COL 2.

"Tim Chapla" <tchapla (AT) nospam (DOT) turnleaf.com> wrote in message
news:e8uILu9hFHA.3640 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
I have a tricky one here.

Basically I have the following, 2 dimensional output

COL 1 COL 2
ROW 1 4 8
ROW 2 2 4
ROW 3 2 2

I am trying to find the syntax, or some workaround, for calculating COL
2, which references COL 1(n) and itself, COL 2(n-1) to calculate:
COL 2(n) = COL 1(n) + COL 2(n-1)

I am trying to reference the PrevMember of COL 2 while generating COL 2.

I've tried generating a calculated member in MDX as such:
member [Measures].[COL2] as '[Measures].[COL1] +
[Measures].[COL2].CurrentMember.PrevMember', format = '#.##'

It just won't allow me to reference something I'm generating like this
on-the-fly. Makes sense. Is there any way to accomplish this with
calculated members, cells, anything?

I am using linear interpolation to estimate Percentile Ranks for Student
scores. The algorithm 'STARTS' here. Phew this is fun.

Any help would be greatly appreciated.

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.