When a filter is defined as part of the report's definition, either as part of a report filter, metric conditionality or security filters, the SQL Engine applies certain rules when deciding if the filter will be applied to the SQL generated for the report, and if so, how to apply the filter correctly.
Some general rules can be identified when analyzing how the filter is applied in the SQL:
- If a filter object is based on an attribute related to a fact (i.e. fact table), the filter will be applied directly when calculating a metric object based on that fact (i.e. the filter condition will be placed in the SQL pass where the metric calculation is being performed).
In this example, a report with Call Center and Employee along with the Units Received metric, and a filter condition based on Employee, shows how this rule is applied: