dbTalk Databases Forums  

MDX Query (New to MDX

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


Discuss MDX Query (New to MDX in the microsoft.public.sqlserver.olap forum.



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

Default MDX Query (New to MDX - 11-17-2004 , 05:19 AM






Please help me to find a better solution for calculating total unit sales of
specific products to customers those who lives in Burnaby,Yakima, Seattle
cities and education level has 'Bachelors Degree', Graduate Degree or High
School
Degree

i have created a Mdx Query using Named sets and Cross Join, that is working
fine

is any simple way to do the same?.


This is my Query

WITH SET [Drink] AS
'{[Product].[All Products].[Drink].[Alcoholic Beverages].[Beer and
Wine].[Wine].[Good].[Good Chardonnay],
[Product].[All Products].[Drink].[Alcoholic Beverages].[Beer and
Wine].[Wine].[Pearl].[Pearl Chardonnay],
[Product].[All Products].[Drink].[Alcoholic Beverages].[Beer and
Wine].[Wine].[Portsmouth].[Portsmouth Chardonnay],
[Product].[All Products].[Drink].[Alcoholic Beverages].[Beer and
Wine].[Wine].[Top Measure].[Top Measure Chardonnay],
[Product].[All Products].[Drink].[Alcoholic Beverages].[Beer and
Wine].[Wine].[Walrus].[Walrus Chardonnay],
[Product].[All Products].[Drink].[Alcoholic Beverages].[Beer and
Wine].[Wine].[Good].[Good Chablis Wine],
[Product].[All Products].[Drink].[Alcoholic Beverages].[Beer and
Wine].[Wine].[Pearl].[Pearl Chablis Wine],
[Product].[All Products].[Drink].[Alcoholic Beverages].[Beer and
Wine].[Wine].[Portsmouth].[Portsmouth Chablis Wine],
[Product].[All Products].[Drink].[Alcoholic Beverages].[Beer and
Wine].[Wine].[Top Measure].[Top Measure Chablis Wine],
[Product].[All Products].[Drink].[Alcoholic Beverages].[Beer and
Wine].[Wine].[Walrus].[Walrus Chablis Wine]}'

Set [City] As
'{[Customers].[All Customers].[Canada].[BC].[Burnaby],
[Customers].[All Customers].[USA].[WA].[Yakima],
[Customers].[All Customers].[USA].[WA].[Seattle]}'

Set [Education] As
'{[Education Level].[All Education Level].[Bachelors Degree],
[Education Level].[All Education Level].[Graduate Degree],
[Education Level].[All Education Level].[High School Degree]}'

member Measures.[testsum] as
'SUM( {CrossJoin ({[Education]}, CrossJoin ({City}, [Drink]))}, [Unit Sales])'

SELECT
{ [Measures].[testsum]} on columns
FROM Sales

Please help me find a solution for this problem


Regards

Subin




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

Default Re: MDX Query (New to MDX - 11-17-2004 , 10:00 AM






You can use nested sum(), in lieu of crossjoin():

Quote:
member Measures.[testsum] as
'Sum([Education], Sum([City},
Sum([Drink], [Unit Sales])))'
Quote:

- Deepak

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


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.