To ensure that a restriction is always inferred when a particular object is used in an end-user query, place the restriction in the Where field of the Dimension Properties tab and use the SQL assistant. You can do this restriction when you create the object or you can add it later.
For example, consider the situation where users of Motors make queries related only to those cars that can be rented. In the Model table in the underlying Motors database, the distinguishing factor between cars that can be rented and those stocked for sale is that the MODEL_DAYRENT column contains data for rental cars and is null for sale-only cars. To create an object to list cars for rental, the object would have to include the restriction:
MODEL.MODEL_DAYRENT IS NOT NULL
Drawback to Adding a WHERE Clause to ObjectsIf two or more similarly restricted objects are included in the same query, the conflict between the WHERE clauses causes no data to be returned. Consider a situation, where a user wanted data for UK clients and US clients. You might think that including both the UK clients and US clients objects would meet that need. However, the inferred SQL for the query would include the following WHERE clauses:
COUNTRY_REGION.COUNTRY_NAME = United Kingdom) and (
COUNTRY_REGION.COUNTRY_NAME = USA)
Since no country satisfies both these conditions, no data is returned.