dbTalk Databases Forums  

Q.Calculated Member

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


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



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

Default Q.Calculated Member - 01-15-2004 , 12:32 AM






Hi
I am new to MDX. If someone can please help me with
simple question

I have to create a calculated member
I have 3 dimensions Product, Time, Sales
I have two measures. CostA, CostB

The result that I want for calculated member is
(sum)costA/(sum)costB

I tried doing [Measures](sum)(costA)/[Measures](sum)
(costB) but got error


Thanks

David

Reply With Quote
  #2  
Old   
Sean Boon [MS]
 
Posts: n/a

Default Re: Q.Calculated Member - 01-15-2004 , 01:56 PM






Create two measures in your cube called CostA and CostB. Use the SUM
aggregate type on these.
Then create a calculated member on the Measures dimension and call it
whatever you'd like and define it as

[Measures].[CostA]/[Measures].[CostB]


--
Sean

--
Sean Boon
SQL Server BI Product Unit

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.

<anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi
I am new to MDX. If someone can please help me with
simple question

I have to create a calculated member
I have 3 dimensions Product, Time, Sales
I have two measures. CostA, CostB

The result that I want for calculated member is
(sum)costA/(sum)costB

I tried doing [Measures](sum)(costA)/[Measures](sum)
(costB) but got error


Thanks

David



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

Default RE: Q.Calculated Member - 01-15-2004 , 02:01 PM



I think this would work for you

((sum([Measures].costA))/(sum([Measures].costA)

you may also want to look at support for divide by zero and formattin
see functions
ISEMPTY(
IIF()
----- anonymous (AT) discussions (DOT) microsoft.com wrote: ----

H
I am new to MDX. If someone can please help me with
simple questio

I have to create a calculated membe
I have 3 dimensions Product, Time, Sale
I have two measures. CostA, Cost

The result that I want for calculated member is
(sum)costA/(sum)cost

I tried doing [Measures](sum)(costA)/[Measures](sum
(costB) but got erro


Thank

Davi


Reply With Quote
  #4  
Old   
Tom Chester
 
Posts: n/a

Default Re: Q.Calculated Member - 01-15-2004 , 02:18 PM



SUM function requires a set as 1st argument.

public @ the domain below
www.tomchester.net

"Jason" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
I think this would work for you:

((sum([Measures].costA))/(sum([Measures].costA))

you may also want to look at support for divide by zero and formatting
see functions:
ISEMPTY()
IIF()
----- anonymous (AT) discussions (DOT) microsoft.com wrote: -----

Hi
I am new to MDX. If someone can please help me with
simple question

I have to create a calculated member
I have 3 dimensions Product, Time, Sales
I have two measures. CostA, CostB

The result that I want for calculated member is
(sum)costA/(sum)costB

I tried doing [Measures](sum)(costA)/[Measures](sum)
(costB) but got error


Thanks

David




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.