Eduard
Eduard

Reputation: 674

SSRS set last row as default value for multi-value parameter

I guess that's easy... I have a multi-value parameter that got the list of values from a query. I would like to select as default value the last row.

Can I achieve this using a expression? I would like to avoid creating a second query just to get the last value from the previous query...

Upvotes: 2

Views: 9512

Answers (2)

Y.V.
Y.V.

Reputation: 1

I am working with SSRS 2012 and I was using a multi select option on my report so when I chose the "Get Values from a query" I got all of the values as the default.

I did find a solution. In my report I needed the default name of the town to be the first one so I created another set with the name of the column and a calculated measure that said "[DimTahanot].[Tahana Name].&[אילת]" and filtered it by the same one. (Please ignore the different language). Although hard coded it was good for this report. You could create another hidden parameter for this set if you need it to be the first one by amount or any other parameters that should effect this value, using the filter as a parameter.

Hope this helps.

Upvotes: 0

Roman Badiornyi
Roman Badiornyi

Reputation: 1539

In the default parameter expression you can't refer to the field of the dataset, so you can't write something like Last(Field!MyVar.Value, "DataSet1"), as a workaround you can order your dataset to retrive last row as first and use "Get values from a query" which choses first row, if you can't do this then replicate your dataset in the only one solution.

Upvotes: 3

Related Questions