wheresaldo
Programmer
Hi,
I have a cube with a time dimension with a Date field and an Hour field. Using MDX, I need to retreive the last 24 hours, starting from the latest hour in the cube. For example: I need to get the last 24 hours from 3-7-08 date hour 12. This means that I need to get hours 13 to 23 from date 3-6-08 and hour 0 to 12 from date 3-7-08. I already get the start date and hour and the end date and hour outside MDX via C# code, but I don't know how to write the MDX that will give me both ranges, 13 to 23 from date 3-6-08 and 0 to 12 from date 3-7-08, together.
What I need to do is something like this:
SELECT NON EMPTY { [Measures].[x] } ON COLUMNS
FROM [xyz]
WHERE ( [xyz Time].[Date].&[2008-03-06T00:00:00], [xyz Time].[Hour].&[13]:[xyz Time].[Hour].&[23])
and join with this:
SELECT NON EMPTY { [Measures].[x] } ON COLUMNS
FROM [xyz]
WHERE ( [xyz Time].[Date].&[2008-03-07T00:00:00], [xyz Time].[Hour].&[0]:[xyz Time].[Hour].&[12])
How do we do this in a single MDX statement?
A
I have a cube with a time dimension with a Date field and an Hour field. Using MDX, I need to retreive the last 24 hours, starting from the latest hour in the cube. For example: I need to get the last 24 hours from 3-7-08 date hour 12. This means that I need to get hours 13 to 23 from date 3-6-08 and hour 0 to 12 from date 3-7-08. I already get the start date and hour and the end date and hour outside MDX via C# code, but I don't know how to write the MDX that will give me both ranges, 13 to 23 from date 3-6-08 and 0 to 12 from date 3-7-08, together.
What I need to do is something like this:
SELECT NON EMPTY { [Measures].[x] } ON COLUMNS
FROM [xyz]
WHERE ( [xyz Time].[Date].&[2008-03-06T00:00:00], [xyz Time].[Hour].&[13]:[xyz Time].[Hour].&[23])
and join with this:
SELECT NON EMPTY { [Measures].[x] } ON COLUMNS
FROM [xyz]
WHERE ( [xyz Time].[Date].&[2008-03-07T00:00:00], [xyz Time].[Hour].&[0]:[xyz Time].[Hour].&[12])
How do we do this in a single MDX statement?
A