dbTalk Databases Forums  

where a range of Quarter?

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


Discuss where a range of Quarter? in the microsoft.public.sqlserver.olap forum.



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

Default where a range of Quarter? - 09-19-2004 , 02:15 AM






The MDX below can select from one quarter
But if I want to select from a range of quater, say Q1..Q3, how can I do?


------------------MDX----------------------------------------------------
SELECT non empty {(measures.members)} on Columns,
NON EMPTY [Store].members on Rows
FROM [Sales]
where [Time].[1997].[Q1]




Reply With Quote
  #2  
Old   
Martin Mason
 
Posts: n/a

Default Re: where a range of Quarter? - 09-19-2004 , 07:47 PM






Create an aggregate member with the range and use the member in the slicer
dimension.

WITH MEMBER [Time].[1997Q1thruQ3] AS 'Aggregate({
[Time].[Q1]:[Time].[Q3] } )'
SELECT NON EMPTY { [Measures].Members } ON COLUMNS,
NON EMPTY [Store].Members ON ROWS
FROM [Sales]
WHERE ( [Time].[1997Q1thruQ3] )

"ad" <ad (AT) wfes (DOT) tcc.edu.tw> wrote

Quote:
The MDX below can select from one quarter
But if I want to select from a range of quater, say Q1..Q3, how can I do?


------------------MDX----------------------------------------------------
SELECT non empty {(measures.members)} on Columns,
NON EMPTY [Store].members on Rows
FROM [Sales]
where [Time].[1997].[Q1]






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

Default Re: where a range of Quarter? - 09-20-2004 , 07:03 AM



Thank!
Your answer is great!

"Martin Mason" wrote:

Quote:
Create an aggregate member with the range and use the member in the slicer
dimension.

WITH MEMBER [Time].[1997Q1thruQ3] AS 'Aggregate({
[Time].[Q1]:[Time].[Q3] } )'
SELECT NON EMPTY { [Measures].Members } ON COLUMNS,
NON EMPTY [Store].Members ON ROWS
FROM [Sales]
WHERE ( [Time].[1997Q1thruQ3] )

"ad" <ad (AT) wfes (DOT) tcc.edu.tw> wrote in message
news:uxwv$hhnEHA.324 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
The MDX below can select from one quarter
But if I want to select from a range of quater, say Q1..Q3, how can I do?


------------------MDX----------------------------------------------------
SELECT non empty {(measures.members)} on Columns,
NON EMPTY [Store].members on Rows
FROM [Sales]
where [Time].[1997].[Q1]







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.