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 |