Link to home
Start Free TrialLog in
Avatar of WizzoP
WizzoP

asked on

MDX Date Range in Excel

Hi Everyone,
I'm using the CUBE functions in Excel to query my SSAS cube.
I have a CUBEVALUE function and I'm trying to get the value of a measure for a specific date range, like this:-

=CUBEVALUE("jago","({[date].[date time].&[2009-03-12T00:00:00]:[date].[date time].&[2009-03-13T00:00:00]})","[Measures].[Consignment Count]")

but all I get is N/A.

However, if I change the second date to be the same as the first, the query returns the correct answer for 2009-03-12.
Any Ideas? I'm quite new to MDX, so I guess I've made a newbie error!
Avatar of WizzoP
WizzoP

ASKER

I can get now the results I require in Management Studio using this :-
with member [Date].[date time].[wibble] as
 aggregate({[date].[date time].&[2009-03-11T00:00:00]:[date].[date time].&[2009-03-11T00:00:00]})
 select [date].[date time].[wibble] on columns,
 [measures].[consignment count]  on rows
from [MyCube]

but I can't find a way to get an aggregate function into the Cubevalue parameters in Excel.
ASKER CERTIFIED SOLUTION
Avatar of CSLARSEN
CSLARSEN

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of WizzoP

ASKER

Thanks for the response, although it wasn't the one I was hoping for!
I suspect that this requirement wont go away, and that I'll be looking for a solution again soon.