using MDX range inclusive - but differently in 2 different queries
Hi - I searched around for a topic on this and came up empty. I have a query built using the query designer the that retrieves some information based on a date range selected by users at run time (in addition to a couple other parameters not relevant to this discussion) that works fine using the MDX inclusive range. The query designer creates the following select for this range: SELECT( STRTOMEMBER(@FromDateCommonActualDate, CONSTRAINED) : STRTOMEMBER(@ToDateCommonActualDate, CONSTRAINED) ) ON COLUMNS FROM..... I also have a second query in the report that needs that needs to retrieves some "inception to date" information up to and including the "to" date provided by the user. In laymans terms, I need to select all dates <= the "ToDateCommonActualDate". I've tried using both the query designer and custom MDX to achieve this and cannot seem to get it right. Using the query building, I add the same date dimention as a filter, use the Range(Inclusive) as the opertor, and only select the second, or "TO" value checkbox under the parameters section. This correctly adds the ToDate parameter to the query. The problem is getting a value in the FROM date category. I've tried the following, using a dummy from date, as well as NULL: ( SELECT ( [Date - Common].[Actual Date].&[2008-08-20T00:00:00] : STRTOMEMBER(@ToDateCommonActualDate, CONSTRAINED) ) ON COLUMNS ( SELECT ( NULL : STRTOMEMBER(@ToDateCommonActualDate, CONSTRAINED) ) ON COLUMNS Both of these result in an empty set. If I use the FROM and TO paramters to test the query or browse the cube in management studio, I get retrieve data no problems. Any ideas? I really need to find a way to do this as we have a lot of reports that contain more than one dataset and use parameters in a variety of different way to filter data based on user prompts. thanks in advance.
May 17th, 2011 7:52am

Perhaps I will try again and rephrase what I need to do. I have a report with two queries. I want the first query to prompt the user with a FROM and TO date range that they enter for the report filter. This query selects a date dimension called [Date - Common].[Actual Date] It creates the @FromDateCommonActualDate and @ToDateCommonActualDate paramters (and hidden datasets) that provide the users with a lookup of valid dates to select from. For example, they could select from 01-Apr-2011 and to 30-Apr-2011 for this range. The second query needs to select on another date dimension called [Date - Cost].[Actual Date], but up to and including the 30-Apr-2011 range, so I need to select @ToDateCommonActualDate : NULL In a nut shell, can I set the value of @ToDateCommonActualDate parameter to the @ToDateCostActualDate parameter, or is there another way to pass this parameter to query 2? I've tried making an internal parameter and setting the default value of this parameter to @ToDateCommonActualDate and cannot get this to work. thanks in advance for any advice or solutions.
Free Windows Admin Tool Kit Click here and download it now
May 24th, 2011 10:03am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics