JohnSLG


I'm using MDX to query a cube. I have two identical data sets:

WITH MEMBER [Measures].[ParameterCaption] AS '[Date Shipped].[Year-Month].CURRENTMEMBER.MEMBER_CAPTION' MEMBER [Measures].[ParameterValue] AS '[Date Shipped].[Year-Month].CURRENTMEMBER.UNIQUENAME' MEMBER [Measures].[ParameterLevel] AS '[Date Shipped].[Year-Month].CURRENTMEMBER.LEVEL.ORDINAL' SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS , [Date Shipped].[Year-Month].ALLMEMBERS ON ROWS FROM [Heidtman DW]

How do I get one to be the "From" date and the other to be the "Thru" date

I'm passing the correct parameters ([Date Shipped].[Month].&[2006]&[4]&[12]) & ([Date Shipped].[Month].&[2007]&[4]&[11]) but I don't know how to tell the query to use them correctly.




Re: From and Thru Date parameters

tee_user5


For your query that uses the parameter values, use the query designer without the text view and drag the date attribute to the top filter pane, and select operator: range inclusive, and check both boxes for parameters start and end.

but if you want to do it with a custom mdx query, something like this should work:

select ... on columns,

... on rows

from (select {STRTOMEMBER(@start) : STRTOMEMBER(@end) } on columns from YourCube)






Re: From and Thru Date parameters

JohnSLG

Thanks. That makes a LOT of sense (and even generates the MDX code for me).

I picked up another problem along the way and now it says I'm not specifying one or more required parameters even though I'm defining both.........it's always something.






Re: From and Thru Date parameters

tee_user5

When I get those types of errors, it's usually from a dataset up the chain which automatically got a parameter slapped onto it by the IDE and is not getting the value from anything.

You could search the rdl file in notepad to better find that specific section and dataset name, then go into the dataset and remove parameters from all areas: details, parameters tab, and in the designer, the query parameters toolbar button. It may also help to close and reopen the solution after this has been done to ensure there's no more sh going on from the IDE.





Re: From and Thru Date parameters

JohnSLG

For some reason (I first did this report several months ago then broke it when I changed my cube structure) I was passing the parameters with paranthesis around them: ="(" & code.FromDate(Pa....) & ")". I don't remember why I did that and removing them fixed it.

Thanks!!!!