Hi there,
I was working with default parameter values for Dates in my report.
What I want is to set the latest loaded date in my DWH as the default vale.
I did it ok with text parameter using this formula in my expression default value:
="tail(NonEmptyCrossJoin([Date].[Hierarchy1].Members * [Measures].[Amount])).item(0).item(0)"
And in my dataset parameter:
=Parameters!ProcessDate.Value
Now, I converted my date parameter to use a Calendar picker, so I changed its datatype from text to DateTime
My new date parameter value is:
=Today()
And my dataset parameter:
="[Date].[Date].&[" + Format(CDate(Parameters!ProcessDate.Value),"yyyy-MM-dd") + "T00:00:00]"
And it works perfectly!
But, now, I want to set my default date parameter again to the latest loaded date in my DWH as I wrote before, so I changed the date parameter to:
="tail(NonEmptyCrossJoin([Date].[Hierarchy1].Members * [Measures].[Amount])).item(0).item(0)"
Instead of today()
And this doesnt work because I think it is expecting a string date,
Y tried
CDate("tail(NonEmptyCrossJoin([Date].[Hierarchy1].Members * [Measures].[Amount])).item(0).item(0)")
CDate("(tail(NonEmptyCrossJoin([Fecha Proceso].[Jerarquia2].Members * [Measures].[Monto Linea Funcional])).item(0).item(0)).Member_Caption")
And this doesnt work either,
How can I return the tail value from MDX, convert it to text, and then with CDate convert it to Date?