When you create a view that references another service, Aptify generates the necessary SQL automatically to retrieve the desired information. For the sake of efficiency, Aptify generates a single sub-query for all filter statements that apply to the related service.
This approach is suitable in most cases, although under some circumstances, your view may return no records if the filters you specified are mutually exclusive. Consider the following example:
A user wants to create a view that returns the Persons who are linked to both the Business and Languages topic codes. To that end, the user creates the following filter statements for a view in the Persons service and uses the default AND operator to connect them:
- Filter Statement 1:
- Service: Topic Codes
- Field: Topic Code
- Operator: Exactly Matches
- Value: Business
- Filter Statement 2:
- Service: Topic Codes
- Field: Topic Code
- Operator: Exactly Matches
- Value: Languages
However, this view will return no results because the viewing system generates a single sub-query for both statements: there is no single Topic Code Links record that is linked to both topic codes.
To specify that you want the system to generate a separate sub-query for each filter statement, enclose each filter statement in parentheses within the Filter Logic area, as shown in the following figure.
This automatically generates a new SQL statement that uses two sub-queries to identify topic code relationships. When loaded, this view returns the desired results: the list of Persons who have attended both the Business topic code and the Languages topic code checked.
Comments
Please sign in to leave a comment.