Query?
Posted: Thu Mar 05, 2009 8:47 am
Hi,
I've just started using OLAP and i hava a problem with one mdx querry.
In general:
My cube looks in MSSQL Server Management Studio like:
Cubes -> StatCube -> Measure Groups -> "different measures"
Dimensions -> "different dimensions"
In dimensions among other things i have two dimensions:
1) TimeByMonth->year->month->day
2) TimeByHour->hours (24 members 00-01, 01-02 etc.)
My query looks like:
SELECT {[Dim1].[Dim1].&[value1],[Dim1].[Dim1].&[value2],[Dim1].[Dim1].&[value3],[Dim1].[Dim1].&[value4]}
on columns,
{
[Measures].[some measure],
}
on rows
from StatCube
where (
{[TimeByMonth].[TimeByMonth].[Day].&[93563]},
{[TimeByHour].[Hour].&[5]:[TimeByHour].[Hour].&[16]}
)
And I have a problem with clause where:
I can as it is in query above take statistics for one day [TimeByMonth].[TimeByMonth].[Day].&[93563]} and for different hours of this day {[TimeByHour].[Hour].&[5]:[TimeByHour].[Hour].&[16].
But, i haven't any idea how to do this for different days and different hours of each day.
For example, i want to have in clause where: one day from 03:00 to 13:00 and another day from 6:00 to 10:00?
"and operator" doesn't work.
Could you help me?
Regards
Jacek
I've just started using OLAP and i hava a problem with one mdx querry.
In general:
My cube looks in MSSQL Server Management Studio like:
Cubes -> StatCube -> Measure Groups -> "different measures"
Dimensions -> "different dimensions"
In dimensions among other things i have two dimensions:
1) TimeByMonth->year->month->day
2) TimeByHour->hours (24 members 00-01, 01-02 etc.)
My query looks like:
SELECT {[Dim1].[Dim1].&[value1],[Dim1].[Dim1].&[value2],[Dim1].[Dim1].&[value3],[Dim1].[Dim1].&[value4]}
on columns,
{
[Measures].[some measure],
}
on rows
from StatCube
where (
{[TimeByMonth].[TimeByMonth].[Day].&[93563]},
{[TimeByHour].[Hour].&[5]:[TimeByHour].[Hour].&[16]}
)
And I have a problem with clause where:
I can as it is in query above take statistics for one day [TimeByMonth].[TimeByMonth].[Day].&[93563]} and for different hours of this day {[TimeByHour].[Hour].&[5]:[TimeByHour].[Hour].&[16].
But, i haven't any idea how to do this for different days and different hours of each day.
For example, i want to have in clause where: one day from 03:00 to 13:00 and another day from 6:00 to 10:00?
"and operator" doesn't work.
Could you help me?
Regards
Jacek