dbTalk Databases Forums  

MDX Query with Members and Member Properties

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


Discuss MDX Query with Members and Member Properties in the microsoft.public.sqlserver.olap forum.



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

Default MDX Query with Members and Member Properties - 12-15-2004 , 08:15 AM






Using Foodmart, I need to display all Stores with some detailed information
and Unites Shipped based on Quarters. Here's a list of the items I need:

Columns:
"1998 Q1 Units Shipped"
"1998 Q2 Units Shipped"
"1998 Q3 Units Shipped"

Rows:
"Store City"
"Store Name"
"Store SqFt"

Here's what I got so far:
SELECT
{[Measures].[Units Shipped]} ON COLUMNS,
NON EMPTY [Store].[Store Name].MEMBERS DIMENSION PROPERTIES
[Store].[Store Name].[Store Sqft] ON ROWS
FROM
Warehouse


-----------------------------------
Any help will be greatly appreciated.
Thanks

Francisco Alvarado


Reply With Quote
  #2  
Old   
Peter Yang [MSFT]
 
Posts: n/a

Default RE: MDX Query with Members and Member Properties - 12-15-2004 , 09:20 PM






Hello Francisco,

You could try the following MDX:

SELECT
{[Time].[1998].[Q1], [Time].[1998].[Q2],[Time].[1998].[Q3]} ON COLUMNS,
NON EMPTY [Store].[Store Name].MEMBERS DIMENSION PROPERTIES
[Store].[Store Name].[Store Sqft] ON ROWS
FROM
Warehouse
where [Measures].[Units Shipped]

Hope this is helpful. Have a great day!

Thanks & Regards,

Peter Yang
MCSE2000, MCSA, MCDBA
Microsoft Partner Online Support

Get Secure! - www.microsoft.com/security

================================================== ===
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
Quote:
Thread-Topic: MDX Query with Members and Member Properties
thread-index: AcTisHeU8GHT+uMxTwuQBYyuCKP/lg==
X-WBNR-Posting-Host: 66.107.111.210
From: "=?Utf-8?B?ZnJhbmNpc2NvYWx2YXJhZG8=?="
franciscoalvarado (AT) community (DOT) nospam
Subject: MDX Query with Members and Member Properties
Date: Wed, 15 Dec 2004 06:15:02 -0800
Lines: 28
Message-ID: <066F9E5E-EEF2-4A68-ADCB-54D33D8828E2 (AT) microsoft (DOT) com
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.sqlserver.olap
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.olap:55840
X-Tomcat-NG: microsoft.public.sqlserver.olap

Using Foodmart, I need to display all Stores with some detailed
information
and Unites Shipped based on Quarters. Here's a list of the items I need:

Columns:
"1998 Q1 Units Shipped"
"1998 Q2 Units Shipped"
"1998 Q3 Units Shipped"

Rows:
"Store City"
"Store Name"
"Store SqFt"

Here's what I got so far:
SELECT
{[Measures].[Units Shipped]} ON COLUMNS,
NON EMPTY [Store].[Store Name].MEMBERS DIMENSION PROPERTIES
[Store].[Store Name].[Store Sqft] ON ROWS
FROM
Warehouse


-----------------------------------
Any help will be greatly appreciated.
Thanks

Francisco Alvarado




Reply With Quote
  #3  
Old   
franciscoalvarado
 
Posts: n/a

Default RE: MDX Query with Members and Member Properties - 12-16-2004 , 08:45 AM



Peter,

This is very very close to what I need.
Because of a very specific need I have to run this MDX query thru a Stored
Procedure. When I do, the only thing left from the store information is the
"Store SqFt". Is there any way to also get the "Store City" and the "Store
Name"?
You can run this in Query Analyzer to see what I mean.

SELECT a.* FROM OpenRowset('MSOLAP','DATASOURCE=olapdev1; USER ID=;
PASSWORD=;Initial Catalog=[Foodmart 2000];',
'
SELECT
{[Time].[1998].[Q1], [Time].[1998].[Q2],[Time].[1998].[Q3]} ON COLUMNS,
NON EMPTY [Store].[Store Name].MEMBERS DIMENSION PROPERTIES
[Store].[Store Name].[Store Sqft] ON ROWS
FROM
Warehouse
where [Measures].[Units Shipped]
') as a
go

Any additional help will be greatly appreciated




"Peter Yang [MSFT]" wrote:

Quote:
Hello Francisco,

You could try the following MDX:

SELECT
{[Time].[1998].[Q1], [Time].[1998].[Q2],[Time].[1998].[Q3]} ON COLUMNS,
NON EMPTY [Store].[Store Name].MEMBERS DIMENSION PROPERTIES
[Store].[Store Name].[Store Sqft] ON ROWS
FROM
Warehouse
where [Measures].[Units Shipped]

Hope this is helpful. Have a great day!

Thanks & Regards,

Peter Yang
MCSE2000, MCSA, MCDBA
Microsoft Partner Online Support

Get Secure! - www.microsoft.com/security

================================================== ===
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
| Thread-Topic: MDX Query with Members and Member Properties
| thread-index: AcTisHeU8GHT+uMxTwuQBYyuCKP/lg==
| X-WBNR-Posting-Host: 66.107.111.210
| From: "=?Utf-8?B?ZnJhbmNpc2NvYWx2YXJhZG8=?="
franciscoalvarado (AT) community (DOT) nospam
| Subject: MDX Query with Members and Member Properties
| Date: Wed, 15 Dec 2004 06:15:02 -0800
| Lines: 28
| Message-ID: <066F9E5E-EEF2-4A68-ADCB-54D33D8828E2 (AT) microsoft (DOT) com
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.olap
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.olap:55840
| X-Tomcat-NG: microsoft.public.sqlserver.olap
|
| Using Foodmart, I need to display all Stores with some detailed
information
| and Unites Shipped based on Quarters. Here's a list of the items I need:
|
| Columns:
| "1998 Q1 Units Shipped"
| "1998 Q2 Units Shipped"
| "1998 Q3 Units Shipped"
|
| Rows:
| "Store City"
| "Store Name"
| "Store SqFt"
|
| Here's what I got so far:
| SELECT
| {[Measures].[Units Shipped]} ON COLUMNS,
| NON EMPTY [Store].[Store Name].MEMBERS DIMENSION PROPERTIES
| [Store].[Store Name].[Store Sqft] ON ROWS
| FROM
| Warehouse
|
|
| -----------------------------------
| Any help will be greatly appreciated.
| Thanks
|
| Francisco Alvarado
|
|



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

Default RE: MDX Query with Members and Member Properties - 12-16-2004 , 04:54 PM



Hi Francisco and Peter,

This version of Francisco's Foodmart SQL query returns the Store City
and Store Name as well, though the column names in Query Analyzer is
[Store].Name] for both:

Quote:
SELECT a.* FROM OpenRowset('MSOLAP.2','DATASOURCE=olapdev1; USER ID=;
PASSWORD=;Initial Catalog=[Foodmart 2000];',
'
SELECT
{[Time].[1998].[Q1], [Time].[1998].[Q2],[Time].[1998].[Q3]} ON COLUMNS,
NON EMPTY [Store].[Store Name].MEMBERS DIMENSION PROPERTIES
[Store].[Store City].[Name],
[Store].[Store Name].[Name],
[Store].[Store Name].[Store Sqft] ON ROWS
FROM
Warehouse
where [Measures].[Units Shipped]
') as a
go
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.