简体   繁体   中英

BIDS 2008: Filtering based on the value of a parameter

I'm trying to filter a table based on the value of Parameter and the values for a field.

I'm using FailedFlag which is a field which contains only Yes and No values.

And i'm using a parameter called Filter with Failed Only and All .

Currently i'm using this expression in the tables filter value expression,

=IIF(Parameters!Filter.Value = "Failed Only","Yes", "Yes" OR "No")

The first bit works, when filter is set to Failed Only the table only shows rows where the FailedFlag is Yes however the second part of the expression where the Filter parameter is NOT Failed Only doesn't return any rows.

Thanks

I think your syntax is wrong. IIF has the form

IIF(<expression_to_evaluate>,<value_if_true>,<value_if_false>)

When I try to evaluate "Yes" OR "No" , I get an error. I don't think you can do a logical Or on strings. In the false case, it probably ignores the error expression so it doesn't have a value to use for filtering.

In your table Filters, set this as the expression

=IIF(Parameters!Filter.Value "Failed Only", "Yes", "No")

Set the operator dropdown box to = , and in the value box put =Fields!FailedFlag.Value

Hopefully this screenshot clarifies.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM