Example – Filtering Measures

This example filters a text table using an aggregated measure, and then filters the table using the same measure in a disaggregated state.
  1. Create the initial view using the Superstore sample data source. The text table is shown below.

  2. Filter the data to only show orders with an average quantity of 26 or more. You can create this type of filter by dragging the Order Quantity measure to the Filters shelf and select Average as the aggregation.
    The Filter dialog box is shown below. This type of filter is an At Least filter with the minimum value set to 26.

  3. When finished, click OK.
    The modified view is shown below. Comparing this view with the original, unfiltered view is straightforward because the measure and the filter use the same aggregation. For example, the Copiers & Faxes category shipped by Regular Air is removed from the view because the average order quantity is less than 26, while Copiers & Faxes shipped by Delivery Truck and Express Air remains in the view because the average order quantity is greater than 26.

  4. Now let’s filter the same view using a disaggregated measure. Suppose you want to filter the view using the disaggregated Order Quantity measure. To do this, select Dimension on the context menu of the AVG(Order Quantity) field on the Filters shelf.

    The Filter dialog box is shown below. It displays the limits of the individual rows for the Order Quantity measure. Specify a new lower limit of 26.

    The filtered data view is shown below. Notice that the numbers are very different from the original, unfiltered view. This is because Tableau excludes each row in the data source that has an order quantity that is less than 26, and then aggregates the remaining rows as an average.

No comments:

Post a Comment