Variable Filters

Matthew Fifield -

Variable Filters are linked to a Parameter, that when used can modify a filter statement.  This 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 guide to create and use a Variable filter with a parameter.  The Parameter is inside the following Advanced Filter Statement:

SQLUser_UU_COLLECTION_SUPERVISOR.Debtor_Pay_Rate IS NOT NULL   AND SQLUser_Payment_History.OCCURENCE_DATE >= '2016-09-01'  AND SQLUser_Payment_History.OCCURENCE_DATE <= '2016-09-30' ?VariableTest?

  1. In this example, we added a new Parameter and Named it "VariableTest".  This parameter will use a variable filter to add an additional filter statement to the statement above.

    1. Set the Datatype to None (default)
    2. Set the Default Value to "N"
    3. Set the Description to: Select (Y) to use the additional Filter Statement
    4. Set the type to a "Combobox"
    5. Inside of the values list add the items "Y" and "N".  This step is important as these are going to be the names of the variable filters.
    6. Set the Variable Filter equal to True




  2. Add two Variable Filters to the view by clicking the "+" in the Variable Filters section.



  3. Rename one of the Variable filters to "Y" and the other to "N".  This is what links these two variable filters to the Parameter that will be driving which Variable Filter to use (the values list in the parameter contains the names of the corresponding Variable Filters).



  4. Inside of the "Y" Variable Filter add the additional Filter statement to be added.  In this example, we used: "AND SQLUser_User_Master.Group_Suprs_ID = 100"



  5. Leave the statement for the "N" Variable filter empty.

  6. When searching the view, if the VariableTest parameter value selected is "Y", the entire filter statement will be: "SQLUser_UU_COLLECTION_SUPERVISOR.Debtor_Pay_Rate IS NOT NULL   AND SQLUser_Payment_History.OCCURENCE_DATE >= '2016-09-01'  AND SQLUser_Payment_History.OCCURENCE_DATE <= '2016-09-30' AND SQLUser_User_Master.Group_Suprs_ID = 100"



  7. When searching the view, if the VariableTest Parameter value selected is "N", no additional statement is added (because we left the statement empty), and the filter statement would be: "SQLUser_UU_COLLECTION_SUPERVISOR.Debtor_Pay_Rate IS NOT NULL   AND SQLUser_Payment_History.OCCURENCE_DATE >= '2016-09-01'  AND SQLUser_Payment_History.OCCURENCE_DATE <= '2016-09-30'"

Have more questions? Submit a request

Comments

Powered by Zendesk