dbTalk Databases Forums  

Simple (?) MDX Query

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


Discuss Simple (?) MDX Query in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
arduk@hotmail.com
 
Posts: n/a

Default Simple (?) MDX Query - 10-20-2003 , 12:30 AM






I have constructed a sales cube
Customers can be grouped by Region, and also by Corporate Banner (eg
Caltex, McDonalds)
SalesItem is the fact table, and there are two dimensions -
Customer.Region and Customer.Banner

I am trying to build a query that will display the count of customers
(and the count as a percentage of total customers) for each Region,
for each Banner. So the results will be Banners across the top,
Regions down the side, and the cells will contain the number of
customers for the given Banner & Region

I have the following MDX which returns the banners and Regions:

SELECT {[Customer].[Banner].[Banner Code].Members} on COLUMNS,
{[Customer].[Location].[Region Name].Members} on ROWS
FROM [sales]

but I can't get the count of customers for banner and region

as a newbie to olap and MDX, I am struggling a little with simple
queries, so any help on this would be appreciated!!!

Thanks in advance for any help

Reply With Quote
  #2  
Old   
dpuri
 
Posts: n/a

Default Re: Simple (?) MDX Query - 10-20-2003 , 06:23 PM






Is there a Customer table that joins to the SalesItem fact table by a
foreign key like CustomerID? If this key is numeric, you can define a
measure on it with an Aggregation Function of Distinct Count, which will
give the #Customers.

- 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.