Question : Problem with default values in SSRS2008

I'm trying to make the default value for certain parameter be the lastvalue in my Full Date attribute,  but can't seems to find the appropriated code to do so.

In Parameter Properties -> Default Values I choose "Get values from a query", where the query is the one attached in the code snippet. It only returns the last value in the for that attribute, that is, 2009-11-01.

If we look at the [Full Date] Value.png then this is how the Full Date dimension looks like. But when I drag specific value in f.exs. Management Studio then it looks like this: [Dates].[Full Date].&[2009-11-01T00:00:00]

When I preview the report, it's like the default value has no affect on the parameter and it returns only
1:
2:
3:
4:
5:
6:
7:
8:
with member Currentdate as 'CSTR(YEAR(now())) + "-" + CSTR(MONTH(NOW())) + "-01"'
 
select
Currentdate on 0
from [CUBE]
 
Returning:
2009-12-01

Answer : Problem with default values in SSRS2008

Based on what I saw in your query, I'll assume that you're trying to set the default to the first day of the current month.

For the Default Value of your parameter, you don't need to choose "Get values from a query", it should work just fine if you select "Specify values", click the Add button to add a value and then use the Expression Builder to construct a value that your dimension recognizes (click the small fx button on the right of the Null value).

So what you need to get to is something like this (as result of the expression):
[Dates].[Full Date].&[2009-12-01T00:00:00]

That can be achieved with the expression in the snippet.

Regards,
Valentino.
1:
="[Dates].[Full Date].&[" & Year(Now()) & "-" & Month(Now()) & "-01T00:00:00]"
Random Solutions  
 
programming4us programming4us