dbTalk Databases Forums  

Simple MDX Question ...

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


Discuss Simple MDX Question ... in the microsoft.public.sqlserver.olap forum.



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

Default Simple MDX Question ... - 03-02-2005 , 05:43 AM






Hi All,

Have a look at the followind MDX (Yes, it works with FoodMar 2000
also)

-------------------------
With
Member Customers.[Customers_123] AS 'SUM ( {
Customers.[Country].[Canada], Customers.[Country].[Mexico],
Customers.[Country].[USA] } )'
Member Gender.[Genders_123] AS 'SUM ( {Gender.[Gender].[F],
Gender.[Gender].[M] } )'
SELECT {{Measures.[Profit],Measures.[Store Sales]}} ON COLUMNS,
{CrossJoin({Gender.[Genders_123]}, {Customers.[Customers_123]}) }
ON ROWS FROM [Sales] CELL PROPERTIES
[VALUE],[FORMATTED_VALUE],[CELL_ORDINAL]
---------------------------

The Result is Like This :: (It will look good when seen with Fixed
Character Width)

+------------+--------------+--------------------------+
Quote:
| | Profit | Store Sales |
------------+--------------+--------------------------+
Genders_123 | Customers_123| 339,610.90 | $565,238.13 |
+---------------------------+--------------------------+


But i Want Result in this format :


+--------------+---------+--------------+
Quote:
| Profit | Store Sales |
--------------+---------+--------------+
Genders_123 | # VALUE | # VALUE |
+--------------+---------+--------------+
Customer_123 | # VALUE | # VALUE |
+--------------+---------+--------------+

Any idea what i need alter with MDX or any other suggestion



Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Simple MDX Question ... - 03-02-2005 , 11:23 AM






What you want is members of different dimensions on the same MDX query
axis - this can't be done directly, but in previous threads, approaches
like this were suggested:

Quote:
With
Member Customers.[Customers_123] AS 'SUM ( {
Customers.[Country].[Canada], Customers.[Country].[Mexico],
Customers.[Country].[USA] } )'
Member Gender.[Genders_123] AS 'SUM ( {Gender.[Gender].[F],
Gender.[Gender].[M] } )'
SELECT {{Measures.[Profit],Measures.[Store Sales]}} ON COLUMNS,
{(Customers.[Customers_123], [Gender].[All Gender]),
([Customers].[All Customers], Gender.[Genders_123])}
ON ROWS FROM [Sales]
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


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

Default Re: Simple MDX Question ... - 03-02-2005 , 07:05 PM



Sometimes I also asked that kind of requirement.

It needs to divide your MDX statement into two or more statements and
execute them at the same time. Furthermore, client UI has to support it.

Actually, there is a tool, Geac Decision(prior Comshare Decision), that
supports your requrement just through UI operation.

http://www.performance.geac.com/decision/decision.cfm

Ohjoo Kwon



"Muhammad Mansoor" <mmansoor (AT) gmail (DOT) com> wrote

Quote:
Hi All,

Have a look at the followind MDX (Yes, it works with FoodMar 2000
also)

-------------------------
With
Member Customers.[Customers_123] AS 'SUM ( {
Customers.[Country].[Canada], Customers.[Country].[Mexico],
Customers.[Country].[USA] } )'
Member Gender.[Genders_123] AS 'SUM ( {Gender.[Gender].[F],
Gender.[Gender].[M] } )'
SELECT {{Measures.[Profit],Measures.[Store Sales]}} ON COLUMNS,
{CrossJoin({Gender.[Genders_123]}, {Customers.[Customers_123]}) }
ON ROWS FROM [Sales] CELL PROPERTIES
[VALUE],[FORMATTED_VALUE],[CELL_ORDINAL]
---------------------------

The Result is Like This :: (It will look good when seen with Fixed
Character Width)

+------------+--------------+--------------------------+
| | | Profit | Store Sales |
|------------+--------------+--------------------------+
|Genders_123 | Customers_123| 339,610.90 | $565,238.13 |
+---------------------------+--------------------------+


But i Want Result in this format :


+--------------+---------+--------------+
| | Profit | Store Sales |
|--------------+---------+--------------+
|Genders_123 | # VALUE | # VALUE |
+--------------+---------+--------------+
|Customer_123 | # VALUE | # VALUE |
+--------------+---------+--------------+

Any idea what i need alter with MDX or any other suggestion




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.