dbTalk Databases Forums  

How to restrict for a period range in MDX

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


Discuss How to restrict for a period range in MDX in the microsoft.public.sqlserver.olap forum.



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

Default How to restrict for a period range in MDX - 06-04-2005 , 08:03 AM






I have a Dimension called Period in my Cube the data type being
Integer.

The values stored in Period are like the following:

200503
200502
200501
200412
200411
200410
200409
200408
200407
200406
200405


I would like to run a MDX query something like the following

Select {} on Rows,
{} on Columnd

where ((Period > 200408) and (Period < 200503))


Please help how I can do this in MDX.

Thanks
Karen


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

Default RE: How to restrict for a period range in MDX - 06-04-2005 , 05:22 PM






The where clause of an MDX statement contains a single tuple (that is, a
slice of the cube). Since May 2004 through Mar 2005 doesn't roll up into one
parent, you'll need to create a calculated member to get what you want.
Something like this...

with Member [Period].[CustomRange] as
'Sum([Period].[200408]:[Period].[200503])'
Select {} on Rows,
{} on Columns
from YourCube
where ([Period].[CustomRange])

If instead you wanted to list all of those months on rows, you'd do:

Select {[Period].[200408]:[Period].[200503]} on Rows,
{} on Columns
from YourCube

Hope that helps.

"karenmiddleol (AT) yahoo (DOT) com" wrote:

Quote:
I have a Dimension called Period in my Cube the data type being
Integer.

The values stored in Period are like the following:

200503
200502
200501
200412
200411
200410
200409
200408
200407
200406
200405


I would like to run a MDX query something like the following

Select {} on Rows,
{} on Columnd

where ((Period > 200408) and (Period < 200503))


Please help how I can do this in MDX.

Thanks
Karen



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.