How to aggregate across a specific time range?
In this posting we discuss how to aggregate data across a specific time range. In the query below, we define a calculated member ([Time].[MyTime]) that uses the Aggregate function to aggregate data across the specific time range that is specified by the set "[Time].[1997].[Q1].[1]:[Time].[1997].[Q2].[6]". This set uses the ":" operator to specify a contiguous range of values in our time dimension. We then use this newly created calculated member in our where close to force our values to be aggregated across this time period.
Here's the query...
with
member [Time].[MyTime] as
'
Aggregate([Time].[1997].[Q1].[1]:[Time].[1997].[Q2].[6])
'
select
{
[Store].[USA].Children
} on columns,
{
[Measures].[Unit Sales]
} on rows
from Sales
where
(
[Time].[MyTime]
)


