dbTalk Databases Forums  

Problem with Custom Rollup Formula

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


Discuss Problem with Custom Rollup Formula in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jimmy Garino Houdelath - OLAP Monkey
 
Posts: n/a

Default Problem with Custom Rollup Formula - 10-26-2005 , 05:12 PM






Hi!

I am working with MSAS 2000 and I need to overrride the Aggregate Function
of the measures. They are asking me to show the last price registered on a
specific month.
For example, when showing the price for the month of October, the cell must
show me the value registered for Octuber 31st (instead of a sum).

The way I am doing it is by introducing on the Time Dimension, in the Custom
Rollup Formula option the line Time.CurrentMember.LastChild and I make a full
process of the cube.

When I explore the data, I see that the measure is not rolling up the way I
wanted but it is suming up!

I've tried on every level of the dimesion (month, year, All) but nothing and
now I am without ideas. Please help and thanks in advance!

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

Default Re: Problem with Custom Rollup Formula - 10-26-2005 , 08:27 PM






That sounds strange as Time.CurrentMember.LastChild is the example they
use in BOL. Do you possibly have other calculated cells/measures that
could be interfering with this calculation?

Another problem with this approach is that the last child may not have
any data. If you want to get the last child with data you would need to
set up a calculated measure similar to the one below. It grabs the set
of leaf members from the time dimensions, excludes the empty ones and
grabs the last member from the remainder.

Quote:
WITH
MEMBER Measures.LastLeafValue as 'SUM(TAIL(FILTER(DESCENDANTS
([Time].CurrentMember,,LEAVES),NOT IsEmpty(Measures.[Unit
Sales])),1),Measures.[Unit Sales])'
SELECT
{Measures.[Unit Sales],Measures.LastLeafValue} on columns,
[Time].members on rows
FROM Sales
Quote:
Note: When AS2k5 comes out, you will be able to do this in AS2k5, by
setting the aggregation property of the measure to "LastChild"

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

In article <15140477-6A38-4582-A43E-E294FAC6B018 (AT) microsoft (DOT) com>, =?Utf-
8?B?SmltbXkgR2FyaW5vIEhvdWRlbGF0aCAtIE9MQVAgTW9ua2 V5?= <Jimmy Garino
Houdelath - OLAP Monkey (AT) discussions (DOT) microsoft.com> says...
Quote:
Hi!

I am working with MSAS 2000 and I need to overrride the Aggregate Function
of the measures. They are asking me to show the last price registered on a
specific month.
For example, when showing the price for the month of October, the cell must
show me the value registered for Octuber 31st (instead of a sum).

The way I am doing it is by introducing on the Time Dimension, in the Custom
Rollup Formula option the line Time.CurrentMember.LastChild and I make a full
process of the cube.

When I explore the data, I see that the measure is not rolling up the way I
wanted but it is suming up!

I've tried on every level of the dimesion (month, year, All) but nothing and
now I am without ideas. Please help and thanks in advance!


Reply With Quote
  #3  
Old   
Jimmy Garino Houdelath - OLAP Monkey
 
Posts: n/a

Default Re: Problem with Custom Rollup Formula - 10-27-2005 , 11:52 AM



Hmmm...
Besides the Time.CurrentMember.LastChild (I adapted it to my cube), the Data
Mart is complete.
On the other hand, there is no calculated cells that interfiers with the
measures because this problem happens also with measures that are not used in
any calculated members.

I also tried with firstChild, closingPeriod (just for fun) and nothing
happens. I really don't know if there is a bug on MSAS 2000. I haven't tried
your code but I will be in the next hours. Thank you


"Darren Gosbell" wrote:

Quote:
That sounds strange as Time.CurrentMember.LastChild is the example they
use in BOL. Do you possibly have other calculated cells/measures that
could be interfering with this calculation?

Another problem with this approach is that the last child may not have
any data. If you want to get the last child with data you would need to
set up a calculated measure similar to the one below. It grabs the set
of leaf members from the time dimensions, excludes the empty ones and
grabs the last member from the remainder.


WITH
MEMBER Measures.LastLeafValue as 'SUM(TAIL(FILTER(DESCENDANTS
([Time].CurrentMember,,LEAVES),NOT IsEmpty(Measures.[Unit
Sales])),1),Measures.[Unit Sales])'
SELECT
{Measures.[Unit Sales],Measures.LastLeafValue} on columns,
[Time].members on rows
FROM Sales


Note: When AS2k5 comes out, you will be able to do this in AS2k5, by
setting the aggregation property of the measure to "LastChild"

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

In article <15140477-6A38-4582-A43E-E294FAC6B018 (AT) microsoft (DOT) com>, =?Utf-
8?B?SmltbXkgR2FyaW5vIEhvdWRlbGF0aCAtIE9MQVAgTW9ua2 V5?= <Jimmy Garino
Houdelath - OLAP Monkey (AT) discussions (DOT) microsoft.com> says...
Hi!

I am working with MSAS 2000 and I need to overrride the Aggregate Function
of the measures. They are asking me to show the last price registered on a
specific month.
For example, when showing the price for the month of October, the cell must
show me the value registered for Octuber 31st (instead of a sum).

The way I am doing it is by introducing on the Time Dimension, in the Custom
Rollup Formula option the line Time.CurrentMember.LastChild and I make a full
process of the cube.

When I explore the data, I see that the measure is not rolling up the way I
wanted but it is suming up!

I've tried on every level of the dimesion (month, year, All) but nothing and
now I am without ideas. Please help and thanks in advance!



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.