Friday, April 20, 2012 9:44 AM
On my report I have 5 tablix controls.
I have a multi value parameter that allows the user to select a maximum of 5 values.
I need to use each value of my multi value parameter to filter the data in the 5 tablix controls.
This work fine if i select 5 values, but when I select anything less i'm encountering an error.
This is the code that I am trying to use to pass a value to the filter if 5 values aren't selected, but it is failing whenever anything less than 5 values are chosen.
=iif(Parameters!iproduct_counter.count = 5, Parameters!iproduct_counter.Value(4),
iif(Parameters!iproduct_counter.count = 4, Parameters!iproduct_counter.Value(3),
iif(Parameters!iproduct_counter.count = 3, Parameters!iproduct_counter.Value(2),
iif(Parameters!iproduct_counter.count = 2, Parameters!iproduct_counter.Value(1),
Thanks in advance
Friday, April 20, 2012 11:34 AM
IIF will evaluate all its arguments before its evaluated.
If one argument cannot be evaluated because it raises an exception, the whole expression will return an error, even though the argument should never have been reached in the first place.
Can you elaborate on why, you use such an expression to filter your parameters in the first place?
Are you only interested in filtering your tables on the value of the last parameter?
will return the complete array. You can use it as the right hand side of a filter expression with the IN operator.
Friday, April 20, 2012 12:14 PM
Not sure about your actual requirements.
Instead of your statement following code will work without error and with same result!
=Parameters!product_counter.Value(Parameters!product_counter.Count - 1)
Bipin. P | ERNST & YOUNG GSS