dbTalk Databases Forums  

Calculated Member Problem

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


Discuss Calculated Member Problem in the microsoft.public.sqlserver.olap forum.



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

Default Calculated Member Problem - 12-23-2004 , 08:39 AM






Hi Guys,
Im designing a writeback cube in AS to assist in our prodcution planning
function which is primarily to show the effect on the monthly build plan
value when quantities of products in the plan are ammended.

I have two measures in my fact table Qty and Cost

I have a Calculated Member in the Cube - Value = (Qty * Cost)

I have a Product Dimension with 4 levels :

Product Type
Product Group
Product Subgroup
Product ID.

The general idea is the a user changes the Qty field which in turn
influences the Calculated Member Value

At the lowest leaf level of the Product Dimension the Calculated Member is
correct, However, when we drill up to the next level it is not,

eg :

ProductID Qty Cost Value
Item1 1 200 200
Item2 10 100 1000
Item3 10 50 500

When we drill up we get not the total of the Values ie 1700, but the total
Qty * total Cost, ie 21 * 350 and this continues up through the Product
dimension.

There must be a way around this, ... is there ?

Many Thanks in Advance,
Steve.


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

Default Re: Calculated Member Problem - 12-24-2004 , 10:54 AM






Cost is non-additive measure and your value must be calculated at only leaf
level before aggregation. You can try next expression but you may run into
performance issue if you have many dimensions to be considered. My example
considers only product dimension.

Value:
IIF(IsLeaf(Product.CurrentMember), Qty * Cost,
SUM(Product.CurrentMember.Children, Value))

or

SUM(Descendants(Product.CurrentMember, [Product ID]), Qty * Cost)

Ohjoo Kwon
www.olapforum.com


"Skull Monkey" <skull (AT) skullmonkey (DOT) co.uk> wrote

Quote:
Hi Guys,
Im designing a writeback cube in AS to assist in our prodcution planning
function which is primarily to show the effect on the monthly build plan
value when quantities of products in the plan are ammended.

I have two measures in my fact table Qty and Cost

I have a Calculated Member in the Cube - Value = (Qty * Cost)

I have a Product Dimension with 4 levels :

Product Type
Product Group
Product Subgroup
Product ID.

The general idea is the a user changes the Qty field which in turn
influences the Calculated Member Value

At the lowest leaf level of the Product Dimension the Calculated Member is
correct, However, when we drill up to the next level it is not,

eg :

ProductID Qty Cost Value
Item1 1 200 200
Item2 10 100 1000
Item3 10 50 500

When we drill up we get not the total of the Values ie 1700, but the total
Qty * total Cost, ie 21 * 350 and this continues up through the Product
dimension.

There must be a way around this, ... is there ?

Many Thanks in Advance,
Steve.




Reply With Quote
  #3  
Old   
Skull Monkey
 
Posts: n/a

Default Re: Calculated Member Problem - 01-04-2005 , 03:43 AM



Many Thanks Ohjoo, .. that works just fine.

Regards,
Steve.

"Ohjoo Kwon" wrote:

Quote:
Cost is non-additive measure and your value must be calculated at only leaf
level before aggregation. You can try next expression but you may run into
performance issue if you have many dimensions to be considered. My example
considers only product dimension.

Value:
IIF(IsLeaf(Product.CurrentMember), Qty * Cost,
SUM(Product.CurrentMember.Children, Value))

or

SUM(Descendants(Product.CurrentMember, [Product ID]), Qty * Cost)

Ohjoo Kwon
www.olapforum.com


"Skull Monkey" <skull (AT) skullmonkey (DOT) co.uk> wrote in message
news:17381948-115D-4145-9C79-72E6BDAB6735 (AT) microsoft (DOT) com...
Hi Guys,
Im designing a writeback cube in AS to assist in our prodcution planning
function which is primarily to show the effect on the monthly build plan
value when quantities of products in the plan are ammended.

I have two measures in my fact table Qty and Cost

I have a Calculated Member in the Cube - Value = (Qty * Cost)

I have a Product Dimension with 4 levels :

Product Type
Product Group
Product Subgroup
Product ID.

The general idea is the a user changes the Qty field which in turn
influences the Calculated Member Value

At the lowest leaf level of the Product Dimension the Calculated Member is
correct, However, when we drill up to the next level it is not,

eg :

ProductID Qty Cost Value
Item1 1 200 200
Item2 10 100 1000
Item3 10 50 500

When we drill up we get not the total of the Values ie 1700, but the total
Qty * total Cost, ie 21 * 350 and this continues up through the Product
dimension.

There must be a way around this, ... is there ?

Many Thanks in Advance,
Steve.





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.