dbTalk Databases Forums  

MDX Statement - How do I add two measures using a With Member?

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


Discuss MDX Statement - How do I add two measures using a With Member? in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
James Woo via SQLMonster.com
 
Posts: n/a

Default MDX Statement - How do I add two measures using a With Member? - 04-15-2005 , 10:31 AM






Hi All,

I have to measures: [measures].[cost] and [measures].[budget].
I would like to add then within an MDX statement as such:

SELECT
([measures].[cost] + [measures].[budget]) ON COLUMNS,
{[products].[products].members} ON ROWS
FROM [sales]

How can I get the addition of two measures within MDX statement without
adding a calculated member at the Analysis Services cube level.

Thank you
JAMES

--
Message posted via http://www.sqlmonster.com

Reply With Quote
  #2  
Old   
SQL McOLAP
 
Posts: n/a

Default RE: MDX Statement - How do I add two measures using a With Member? - 04-15-2005 , 11:47 AM






Create a calculated member and seletect it on the columns. YOu can either
create the calc member in the interfact, or in a WITH statement in your MDX.

WITH MEMBER [measures].[SalesAndCost] AS '[measures].[cost] +
[measures].[budget]'
SELECT
([measures].[SalesAndCost]) ON COLUMNS,
{[products].[products].members} ON ROWS
FROM [sales]

"James Woo via SQLMonster.com" wrote:

Quote:
Hi All,

I have to measures: [measures].[cost] and [measures].[budget].
I would like to add then within an MDX statement as such:

SELECT
([measures].[cost] + [measures].[budget]) ON COLUMNS,
{[products].[products].members} ON ROWS
FROM [sales]

How can I get the addition of two measures within MDX statement without
adding a calculated member at the Analysis Services cube level.

Thank you
JAMES

--
Message posted via http://www.sqlmonster.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.