1
votes

ssrs filter tablix expression that will use parameter value to filter tablix

Id like to filter my tablix based on one parameter with 3 possible values to select from. Person Dog Both

Then filter the tablix by field: Person, Dog, Both...

---update

Tablix Filter by parameter values. Goal include ALL

1 Parameter has 3 options (not multi select). PERSON, DOG, ALL.

I have a field built called FILTER that places "ALL" in the cells.

Otherwise its between the field CLIENT_TYPE "PERSON" or "DOG"

expression: Fields!CLIENT_TYPE.Value Value
Parameters!CLIENT_TYPE.Value

This works for "PERSON" and "DOG" only. Dopes Not work for "ALL"

What would be the Expression and Value to filter the tablix according to parameter...

could I trick the "ALL' into excluding nothing?

expression IFF(Parameters!CLIENT_TYPE.Value = Fields!CLIENT_TYPE.Value or Parameters!CLIENT_TYPE.Value = Fields!FILTER.Value , "include" , "Exclude")

Value =Parameters!CLIENT_TYPE.Value

RESOLUTION:

expression

        =(Fields!CLIENT_TYPE.Value = Parameters!CLIENT_TYPE.Value) 
        OR
        (Parameters!CLIENT_TYPE.Value = Fields!FILTER.Value)

value =true

3

3 Answers

0
votes

you will click on your tablix properties -> visibility and then pop and expression like so iif(parameters_p1.value = 'Person',True,False). Keep in mind that if you have a select all option i.e. param can accept multiple values This solution WILL NOT WORK. It will only accept 1 value at a time and render result for that.

0
votes

You'll want to compare your field with the parameter.

For a filter expression, you'd have something like

=IIF(Fields!YOUR_FIELD.Value = Parameters!YOUR_PARAMETER.Value OR Parameters!YOUR_PARAMETER.Value = "Both", 1, 0)

The set the type to integer and the value to 1. This will assign the value of 1 to records that your field matches the parameter or the parameter is both. This assumes that there are no other options however.

You could also map the parameter to your query and filter the query instead of using a filter on the dataset or tablix.

WHERE (YOUR_FIELD = @YOUR_PARAMETER or @YOUR_PARAMETER = 'Both') 
0
votes

1 Parameter (3 options): Person, Dog, All... created a field in sproc: FILTER which holds "ALL" for every cell.

expression =(Fields!CLIENT_TYPE.Value = Parameters!CLIENT_TYPE.Value) OR (Parameters!CLIENT_TYPE.Value = Fields!FILTER.Value)

value =true