Applying filters

If you want to reduce the amount of data available for visualizations or restrict the data for a particular field value, applying filters is a very good solution. This recipe will provide a basic overview of filters, and later in the book you'll see some other uses of filters.

Getting ready

We will use the sample superstore sales saved data source for this exercise. Open a new worksheet and connect to the Sample – Superstore Sales (Excel) data source.

How to do it...

Once the sample file is loaded on the worksheet, perform the following steps to explore the Filters feature in Tableau:

  1. Drag-and-drop Sub-category from Dimensions into the Rows shelf.
  2. Then drag-and-drop Profit from Measures into the Text Marks box. You can also right-click on Profit and click on Add to Sheet. Your worksheet should look like the following screenshot:
    How to do it...
  3. If we want to see the subcategories that generated profit of more than $50,000, right-click on the Text box from the Marks pane box where it says SUM(Profit), and click on Filter
  4. In the Filter dialog box, click on the At Least option and either drag the slide to 50,000 or type 50,000 in the input box and hit OK.
    How to do it...
  5. Once the filter is applied, you'll see eight subcategories that generated profit of more than $50,000.
  6. We can continue to filter this information further. For example, to remove Office Furnishings as a subcategory, right-click on Office Furnishings and click on Exclude. Now only seven rows of subcategories are visible.
    How to do it...
  7. Both the filters will now show up in the Filters pane, as shown in the following screenshot:
    How to do it...
  8. To remove the filters, right-click on the Filters pane and select Clear Shelf.
  9. To change a filter, right-click on the Sub-Category filter from the Filters pane and select Filter.
  10. In the Filter window, you'll see tabs such as General, Wildcard, Condition, and Top.
    How to do it...
  11. In the General tab, you can type or select a value from the field. In the Wildcard tab, you can enter approximate string values to match certain patterns. In the Condition tab, you can enter conditions by the Fields or Formula values. In the Top tab, you can select the top n or bottom n items by a field or using a formula.

How it works...

Filters are a great way to manipulate the data on a worksheet. Depending on the field data type, various types of filters can be applied to a field. These filters can be numeric conditions to limit a numeric field or text patterns to limit a string field.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset