dbTalk Databases Forums  

Aggregation on Calculated Member

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


Discuss Aggregation on Calculated Member in the microsoft.public.sqlserver.olap forum.



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

Default Aggregation on Calculated Member - 12-03-2005 , 06:26 AM






Dear all,

Calculated Member, [Total Sold] = [Measures].[Quantity] * [Measures].[Unit
Price]

How to apply aggregation on the calculated member, [Total Sold],
1000+2000=3000, instead of 6000 ?

Quantity Unit Price Total Sold
Total Product 30 200 6000-->should be 3000
Product A 10 100 1000
Product B 20 100 2000


Thanks in advance,
Tan



Reply With Quote
  #2  
Old   
Jéjé
 
Posts: n/a

Default Re: Aggregation on Calculated Member - 12-03-2005 , 01:31 PM






you have to create an average unit price (UnitPriceSum / UnitPriceCount)
then you'll have the correct value.

or you have to create a new measure (not a calculated measure) which is the
Total Sold value (Qty * Price)

"cct" <peoplecosoftware (AT) newsgroup (DOT) nospam> wrote

Quote:
Dear all,

Calculated Member, [Total Sold] = [Measures].[Quantity] * [Measures].[Unit
Price]

How to apply aggregation on the calculated member, [Total Sold],
1000+2000=3000, instead of 6000 ?

Quantity Unit Price Total Sold
Total Product 30 200 6000-->should be 3000
Product A 10 100 1000
Product B 20 100 2000


Thanks in advance,
Tan




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

Default Re: Aggregation on Calculated Member - 12-03-2005 , 06:34 PM



You need to make the calculated member do the summation at a lower
level than it is currently. Therefore you'll need to force it down to
the lowest level of product to do the summation.

Give the calculation below a try...

SUM(DESCENDANTS([Product].currentmember,[product].[product lowest
level]),[Measures].[Quantity] * [Measures].[Unit Price])

Cheers,
L

cct wrote:
Quote:
Dear all,

Calculated Member, [Total Sold] = [Measures].[Quantity] * [Measures].[Unit
Price]

How to apply aggregation on the calculated member, [Total Sold],
1000+2000=3000, instead of 6000 ?

Quantity Unit Price Total Sold
Total Product 30 200 6000-->should be 3000
Product A 10 100 1000
Product B 20 100 2000


Thanks in advance,
Tan


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

Default Re: Aggregation on Calculated Member - 12-05-2005 , 05:30 AM



In article <uZ5ugAE#FHA.3680 (AT) TK2MSFTNGP09 (DOT) phx.gbl>,
willgart (AT) BBBhotmailAAA (DOT) com says...
Quote:
you have to create an average unit price (UnitPriceSum / UnitPriceCount)
then you'll have the correct value.

Summing the average will not be accurate as the unit price varies

Quote:
or you have to create a new measure (not a calculated measure) which is the
Total Sold value (Qty * Price)

This option would perform best, the SUM(DESCENDANTS(...)) option posted
parallel to this is the MDX way of doing this, but does not perform well
on large dimensions.

Quote:
"cct" <peoplecosoftware (AT) newsgroup (DOT) nospam> wrote in message
news:ugYlBTA%23FHA.1444 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Dear all,

Calculated Member, [Total Sold] = [Measures].[Quantity] * [Measures].[Unit
Price]

How to apply aggregation on the calculated member, [Total Sold],
1000+2000=3000, instead of 6000 ?

Quantity Unit Price Total Sold
Total Product 30 200 6000-->should be 3000
Product A 10 100 1000
Product B 20 100 2000


Thanks in advance,
Tan




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


Reply With Quote
  #5  
Old   
Mosha Pasumansky [MS]
 
Posts: n/a

Default Re: Aggregation on Calculated Member - 12-05-2005 , 08:47 PM



More discussion about this subject here:
http://www.sqljunkies.com/WebLog/mos...2/13/7784.aspx

--
==============================*=================== =
Mosha Pasumansky - http://www.mosha.com/msolap
Analysis Services blog at http://www.sqljunkies.com/WebL*og/mosha
Development Lead in the Analysis Server team
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.
==============================*=================== =
"Lozza" <laurence_hoff (AT) hotmail (DOT) com> wrote

Quote:
You need to make the calculated member do the summation at a lower
level than it is currently. Therefore you'll need to force it down to
the lowest level of product to do the summation.

Give the calculation below a try...

SUM(DESCENDANTS([Product].currentmember,[product].[product lowest
level]),[Measures].[Quantity] * [Measures].[Unit Price])

Cheers,
L

cct wrote:
Dear all,

Calculated Member, [Total Sold] = [Measures].[Quantity] *
[Measures].[Unit
Price]

How to apply aggregation on the calculated member, [Total Sold],
1000+2000=3000, instead of 6000 ?

Quantity Unit Price Total Sold
Total Product 30 200 6000-->should be 3000
Product A 10 100 1000
Product B 20 100 2000


Thanks in advance,
Tan




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.