dbTalk Databases Forums  

MDX query "Filter" Writing

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


Discuss MDX query "Filter" Writing in the microsoft.public.sqlserver.olap forum.



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

Default MDX query "Filter" Writing - 08-02-2004 , 05:44 AM






Hi,
I am new to MDX. I am having a cube with time dimention. From that i
need to get data set filtered by date range.

SELECT { [Measures].[Count] } on columns,
{ [name].Members } on rows
from myCube WHERE "Start Date rage " < DAta < "End Date"


or in sql
SELECT * From table WHERE StartDate < date AND EndDate > date


Thakx,

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

Default Re: MDX query "Filter" Writing - 08-03-2004 , 09:21 AM






With member [Time].[TimeFilter] as
'sum(Filter([Time].[Month].members,cDbl([Time].currentmember.properties("Key"))>200307
AND cDbl([Time].currentmember.properties("Key"))<200311))',
solveorder=10

SELECT { [Measures].[Count]} on columns,
{ [Name].Members } on rows
from sales WHERE([Time].[TimeFilter])


This example is for Months. You can convert it for days.
Here I am assuming that the "keys" that your Time dimension is running
on follows a 'calendar' like sequence.

Filters are usually slow. You can make this faster with some functions
that focus your filtering in a specific section.

Last but not the least: don't forget to declare the "Dimension Type",
and "Level Type" in dimension editor for Time dimension. Or else Time
specific functions may not work.

HTH

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.