Consider the case where a Filter operator in a data mashup has two or more (AND) conditions comparing against user inputs. This article describes how to make these conditions"optional" i.e. ignoring a condition if users do not specify the corresponding user input.
For illustration purposes, we will start with a feed created from the employee table on the DB2 sample database. We will create a data mashup which filter based on job and gender. The difference here is that we will use two separate Filter operators, one for filtering based on job, one for filtering based on gender. By chaining the two Filter operator together, we effectively has an "AND" condition i.e. filtering on both job and gender.
Let's look at how we program each of the Filter operator. We will specify two filtering criteria for each Filter operator and relate the two conditions using "Any" i.e. "Or". For the first condition, it is simply comparing the element value, say "job", against a variable. For the second condition, we compare the length of the variable to 0 to determine if there is a user supplied values. If the user does not specify a parameter value when invoking the data mashup, the variable will be an empty string and the length would be 0. That means the second condition would be true and, with the use of "OR", effectively disable the Filtering.
You can find the fully built out data mashup on greenhouse.