Friday, March 30, 2012

Report's Parameter : From Date to Date

I want to add 2 parameters in my report to delimit a date range. The report is based on Analysis Services 2005 and I have created a Time Dimension. What is the best way to do this ?

I would prefer to use a Datetime parameter type because of the calendar component, but then I don't succeed to associate this parameter with the Time Dimension in the filter expression...

I really need an answer to that question, please help me |||You can't really use a datetime parameter (at least not using the built-in prompting) as AS dates are members of a dimension, not scalars. And you aren't really guaranteed that the range between two members will give you what you want. We could add a feature at some point to convert them but that doesn't exist now.|||

Thanks for the answer.

I just found a solution to my problem, even if the solution is not what I hoped for, it may help someone :

I created two Report Parameters "From Date" and "To Date" which use the calendar component to let the user choose a date. And in my Dataset, in the '...' button, in the 'Parameters' bar, I add a parameter whose value is :

="[Temps].[Temps - Date Key].[" & Year(Parameters!FromTempsTempsCalendrier.Value) & "-" & IIF(Month(Parameters!FromTempsTempsCalendrier.Value)<10,"0","") & Month(Parameters!FromTempsTempsCalendrier.Value) & "-" & IIF(Day(Parameters!FromTempsTempsCalendrier.Value)<10, "0","") & Day(Parameters!FromTempsTempsCalendrier.Value) & " 00:00:00]"

That way, I build the UNIQUENAME properties of my Time Dimension.

But an error occurs when the user select a date which does not exist in the Time Dimension.

|||

Thanks for the possible solution. However, I've been working on following your steps, but I am not getting it to work.

Could you explain in a little more detail how to accomplish this?

No comments:

Post a Comment