dbTalk Databases Forums  

Calculated cell aggregation with parent child

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


Discuss Calculated cell aggregation with parent child in the microsoft.public.sqlserver.olap forum.



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

Default Calculated cell aggregation with parent child - 09-18-2006 , 01:24 PM






Hi,

I'm hoping someone can explain why my aggregation isn't working. I've
broken the problem down to the bare minimum to illustrate the point - I've
got a parent child dimension where each leaf element represents part of an
organisation. Each leaf has a cost associated with it, which is the cost of
running that department. I want the cost of running the department to
aggregate up to the parent.
As a simple test of a calculated cell I've tried this:-
scope ([Measures].[Data],
[Organisation].[Parent ID].[Level 03].children
);
this = [Organisation].[Parent ID].currentmember.properties ("Cost");
end scope;

If I then put the Organisation dimension and the measure onto the SSAS pivot
table I get values for my leaves, but no aggregated value, not even zero.

If I change it to something like this:-
this = 5;
then I see the correct aggregated value. Can someone explain to me what's
going on?

thanks,
Paul.

Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Calculated cell aggregation with parent child - 09-18-2006 , 09:47 PM






What is the data type of the "Cost" property - assuming that is numeric,
you would need to retrieve the strongly-type value (otherwise, if it's a
string, it could be cast):

this = [Organisation].[Parent ID].Properties ("Cost", TYPED);


http://msdn2.microsoft.com/en-us/library/ms144821.aspx
Quote:
SQL Server 2005 Books Online
Properties (MDX)
Updated: 17 July 2006

Returns a string, or a strongly-typed value, that contains a member
property value.

Syntax

Member_Expression.Properties(Property_Name [, TYPED])
...
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


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

Default Re: Calculated cell aggregation with parent child - 09-19-2006 , 01:51 AM



"Deepak Puri" wrote:

Quote:
What is the data type of the "Cost" property - assuming that is numeric,
you would need to retrieve the strongly-type value (otherwise, if it's a
string, it could be cast):

this = [Organisation].[Parent ID].Properties ("Cost", TYPED);


http://msdn2.microsoft.com/en-us/library/ms144821.aspx

SQL Server 2005 Books Online
Properties (MDX)
Updated: 17 July 2006

Returns a string, or a strongly-typed value, that contains a member
property value.

Syntax

Member_Expression.Properties(Property_Name [, TYPED])
...



- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***

Many thanks for the help Deepak.

Paul



Reply With Quote
  #4  
Old   
Zoltan Grose
 
Posts: n/a

Default Re: Calculated cell aggregation with parent child - 09-19-2006 , 04:34 PM



Will SSAS perform an aggregation on a Property? I was under the impression
that only measures are calc'ed up the hierarchy.

-z


On 9/18/06 11:51 PM, in article
A0342728-870C-491F-ABFA-3ED67CAE5BBC...soft (DOT) com, "Paul"
<Paul (AT) discussions (DOT) microsoft.com> wrote:

Quote:
"Deepak Puri" wrote:

What is the data type of the "Cost" property - assuming that is numeric,
you would need to retrieve the strongly-type value (otherwise, if it's a
string, it could be cast):

this = [Organisation].[Parent ID].Properties ("Cost", TYPED);


http://msdn2.microsoft.com/en-us/library/ms144821.aspx

SQL Server 2005 Books Online
Properties (MDX)
Updated: 17 July 2006

Returns a string, or a strongly-typed value, that contains a member
property value.

Syntax

Member_Expression.Properties(Property_Name [, TYPED])
...



- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


Many thanks for the help Deepak.

Paul



Reply With Quote
  #5  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Calculated cell aggregation with parent child - 09-19-2006 , 09:48 PM



In this case, it is still a measure: [Measures].[Data] which is being
aggregated up the hierarchy, but since its values lower in the hierarchy
are overwritten with the corrsponding hierarchy Property values, it is
now the Property values which will be aggregated upwards.


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***

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.