Obs. If you want to comment the content of the tip, please do so in the original source.
|Source:__||Re: Question on how to create a product velocity calculation|
|Date:||Oct 29, 2011|
Here is my current working guess on an order of filter evaluation:
1. Context Filters - temp table in data source, always evaluated first
- Note that if you have a calcuated field that is dependant on a parameter in use as a context filter, changing the parameter value will not cause a regeneration of this temp table.
2. Top and Condition Filters - In the filter dialog for discrete dimension pills (blue pill, non-agg), you have two tabs for Top and Condition. When these are set, they will generate a sub query and join with the data before the where clause is evaluated.
3. General Filters on Non-Aggregated Pills - This includes pills that are dimensions (blue or green pills, non-agg), ad hoc groups, bins, sets and action filters. These are evaluated in the where clause of the query sent to the underlying data source.
- Note that your non-aggregateion calcuation formulas will be evaluated before this point, so you could consider it filtering with a IF statement in a formula that will be evaluated before these normal and context filters.
4. Filters on Aggregated Pills - This includes aggregrations that are a continious measure (green pills, with agg). You cannot place a pill that is a discrete aggregation (blue pills, with agg) on the filter shelf. The work around is to use a calcuated field and hare the test condition performed in an IF statement that returns a number.
5. Filters on Custom Table Calcuations - All Table calculations will be evaluated before filtering on custom table calcuation pills is applied. Generally this is the latest useful filtering
6. Other Late Filtering - you can filter on the fields "Latitude (generated)" and "Longitude (generated)" and filtering on them will be applied after table calculations are evalated. Also you can select dimension values in a view and select "Hide" from the right-click context menu. While this Hide operation is not really a filter, it will remove the display of the marks in that dimension value from view after table calcuations have been evaluated.
7. Pages shelf - I think of the pages shelf like creating a "table shell" that only displays the marks for the current selection. The panes/cells and axis ranges will be bases on all possible page selections. A dimension pill on the pages shelf will be available to table calculations because the pages shelf filtering happens after table calculations are evaluated.
Additionally of note, you can effectivly filter data inside of the formula of a calcuated field, by using things such logical or User functions, and those will be evaluated depending on your formula, either before context filters, after aggregration, or after table calcuations.
This is my current understanding, and I welcome your corrections if I am incorrect in any of these points.