dbTalk Databases Forums  

How to calculate % using calculated Member

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


Discuss How to calculate % using calculated Member in the microsoft.public.sqlserver.olap forum.



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

Default How to calculate % using calculated Member - 01-19-2006 , 02:56 PM






Hi all,

My problem is finding the corrrect functions (MDX) to create the
following report;

Here are the cube details;

Dimensions: Store, Products
Measure: Total Sales

The desired output is;
Total Sales Products
------------------------------------------------
Store 1,0000 X Y Z
---------------
Downtown 500 10% 70% 20%
East-End 200 50% 15% 35%
West-End 100 30% 40% 30%
North 200 65% 5% 30%

If you have any thoughts or examples, it would be appreciated.


Reply With Quote
  #2  
Old   
 
Posts: n/a

Default Re: How to calculate % using calculated Member - 01-20-2006 , 09:26 PM






A query something like the following one against the Foodmart 2000
database should work.

WITH
MEMBER Measures.[Product Percent] as '([Product].CurrentMember,
[Measures].[Store Sales])/([Product].[All Products],Measures.[Store
Sales])', FORMAT_STRING ='0.0%'

SELECT
UNION({([Product].[All Products],Measures.[Store Sales])},{[Product
Family].Members} * {[Measures].[Product Percent]}) ON COLUMNS,
NON EMPTY [Store].Members ON ROWS
FROM Sales

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

In article <1137704201.086703.159350 (AT) g43g2000cwa (DOT) googlegroups.com>,
wkatwork (AT) hotmail (DOT) com says...
Quote:
Hi all,

My problem is finding the corrrect functions (MDX) to create the
following report;

Here are the cube details;

Dimensions: Store, Products
Measure: Total Sales

The desired output is;
Total Sales Products
------------------------------------------------
Store 1,0000 X Y Z
---------------
Downtown 500 10% 70% 20%
East-End 200 50% 15% 35%
West-End 100 30% 40% 30%
North 200 65% 5% 30%

If you have any thoughts or examples, it would be appreciated.




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.