Tuesday, May 7, 2013

Tablix Filtering using exact string match

Overview:


I’m currently producing a report where I have 2 fields called “Company Providing Loan” and “Company Receiving Loan” which is currently displayed within the SSRS Tablix. I have a SSRS multi-value parameter called “Companies” which has the list of all the companies. I’m currently able to create a Tablix filter which allows me to do the following:










Expression : =Fields! Company_Providing_Loan.Value

Operator: In

Value: =Parameters!Companies.Value



Expression : =Fields! Company_Receiving_Loan.Value

Operator: In

Value: =Parameters!Companies.Value



The above solution (filter statement) performs an “AND” clause when filtering the SSRS Tablix. Since I need to perform an “OR” filter on both the fields, I used the following statement which will perform an “OR” filtering on the SSRS Tablix:


Expression (Boolean):


=(Instr(Join(Parameters!Companies.Value), Fields! Company_Providing_Loan.Value)>0) Or (Instr(Join(Parameters!Companies.Value), Fields! Company_Receiving_Loan.Value)>0)


Operator: =


Value: True



Issue: when the filtering is performed the end result of the filtered Tablix includes companies that are not the exact matches of the multi-value parameter selection.


Parameter selection: Adventure Works Ltd


End-result: includes companies with “Adventure Works Ltd”, “Adventure Works International Ltd”, “Adventure Matrix Ltd”, etc…



Any help is much appreciated?


No comments:

Post a Comment