In this post I want to discuss the purpose and give examples of Variable Filters.
What Are Variable Filters?
Variable Filters are linked to a Parameter and when used can modify a filter statement.
Why Use Variable Filters?
They can be useful when the user wants to use either two completely separate filter statements, or a modified filter statement based off of parameter input.
Below is a step by step example/guide to create and use a Variable Filter.
Step 1: Create Your First Parameter
- Set Type to "Combobox"
- Set Datatype to "None" (Default)
- Set Default Value to "N"
- Set the Description. Example: Select (Y) to use the additional Filter Statement
- Set Type to a "Combobox"
- Add the Values List items "Y" and "N". This step is important as these are going to be the names of the Variable Filters. (Spelling And Case Sensitive)
- Set Variable Filter to "True"
Step 2: Add The Variable Filters
- Add Two Variable Filters by clicking the + in the Variable Filters section below Parameters.
- Rename BOTH Variable Filters. The first should have the name "N" and the second "Y".
Step 3: Add The Variable Filter's Statement (SQL Filter Statement)
- Select the "Y" Variable Filter and add the filter statement "(dbo.Orders.EmployeeID IN (1,2,4,6,9))"
- This will be the Value of the parameter when "Y" is selected.
Step 4: Add The Parameter Into FSGS
- Inside the FSGS tab, turn on Advanced Filtering
- Add the parameter to the filter criteria in the advanced filtering section. Parameter Name: ?Parameter1?
Step 5: Run The View & Verify Results
- Run the View selecting N and view available records.
- Run the View selecting Y and view available records.