Building the Smart Query
To build a Smart Query, you apply composite filters to select unions, complements, and intersections of members from the different sets. Unions are selections of members that belong to either but not both of two sets. Intersections are selections of members that belong to all specified sets. Complements are selections of members of one specified set that are not members of another specified set.
You can use sets and composite filters in any combination to create highly complex Smart Queries.
Union of Sets
To select members that belong to either but not both sets, define two or more filters as described in Defining Set Filters from the dimension in Sets for.... For example, in Figure 12-1, the query will return only Product, Level 0 members that are either packaged in cans (Product = Can) or are caffeinated (Product = Caffeinated_True).
Figure 12-1 Union of Sets
![Union of sets as described in the preceding paragraph. Union of sets as described in the preceding paragraph.](img/sq_filt_union.gif)
Intersection of Sets
Intersections include only the members that are common to all specified sets.
To select members common to all specified sets:
-
Define a filter for a set as described in Defining Set Filters.
-
Click the arrow next to the filter name and select Add Filter.
-
Additional Filters and a subset filter are displayed.
-
Define the second filter.
In Figure 12-2, the query will return only Product, Level 0 members that are caffeinated and packaged in a can.
Figure 12-2 Intersection of Sets
![Intersection of sets as described in the preceding paragraph Intersection of sets as described in the preceding paragraph](img/sq_filt_inter.gif)
Complement of Sets
To select only members of a set that are not members of another specified set.
-
From Filters for..., click the arrow next to a filter name and select Add Filter.
Additional Filters and a subset filter are displayed.
-
Define the second filter.
-
Click the arrow next to Additional Filters. and select Exclude.
In Figure 12-3, the query will return only Product, Level 0 members that are caffeinated but are not packaged in a can.
Figure 12-3 Complement of Sets
![Complement of sets as described in the preceding paragraph Complement of sets as described in the preceding paragraph](img/sq_filt_comp.gif)
When you have built the Smart Query, proceed to Completing the Smart Query.