Вы находитесь на странице: 1из 16

TCC 13: Filtering

By: Nelson Norsworthy


Kyle Bohac

INTERNAL ONLY Copyright 2013 Tableau Software

Click Steps

Screenshots

Example 1: Null in Filter


1. Right click on Relation to Road (group) and
select Create Set.

2. Then select all of the values except Null

3. Name this set Relation Filter and select OK

4. Right click the Relation Filter and select


Show Quick Filter

INTERNAL ONLY Copyright 2013 Tableau Software

Click Steps

Screenshots

Example 2: Top 10 per State


1. Right click the State filter and select Apply to
Context

A context filter is a way to establish an important


set of criteria which will be evaluated first and any
other types of filters which are not in the context
will be evaluated after. Basically Context filters
can be considered independent while all other
types of filters not in the context will be
dependent to the filters in the Context. This is
how we are able to see the Top 10 most fatal
wrecks in each state. Tableau first applies the
state filter and then applies the Top 10 filter.

INTERNAL ONLY Copyright 2013 Tableau Software

Click Steps

Screenshots

Example 3: Top N per Region


1. Create a calculated field named Index

2. Type Index() into the calculated field


window.

3. Right click the Index field in the measures


window and select Discrete

4. Place the Index field in between Region


and Product Sub Category.
5. Right click that Index field on the rows shelf
and select Edit Table Calculation
6. Then choose the Advanced option in the
Compute using window.
7. Now move Region and Product Subcategory to
the right side and sort by the Sum of sales
descending. Select OK
8. Choose to restart this index every Region

INTERNAL ONLY Copyright 2013 Tableau Software

9. Hold down the Ctrl key and button and drag


the index field to the Level of Detail.

10. Right click Index and select Continuous.

11. Right click Index again and select Show


Quick Filter

INTERNAL ONLY Copyright 2013 Tableau Software

Click Steps

Screenshots

Example 4: Filtering Measures


1. Drag Profit to the filter shelf

2. Select All values and change the minimum


value to zero.
3. Bonus: If we filter on the Sum of Profit and
move the minimum value to zero the bars will
disappear completely from the view, whereas,
filtering on All Values will only remove the
unprofitable transactions from the bars.

INTERNAL ONLY Copyright 2013 Tableau Software

Click Steps

Screenshots

Example 5: Filtering Across DBs


1. Travel to the Super Store sheet and remove
the Region filter.

2. Right click the white space in the dimension


window and select Create parameter

3. Name this parameter Choose Region and


select String in the Data type: menu.

4. Select the list option and add the Regions into


the list of values. Click OK

5. Create a calculated field and enter


[Region]=[Choose Region] and name this
calculation Region Filter.

6. Repeat Step 5 for the Coffee Chain worksheet


using [Market]=[Choose Region] and name
this calculated field Region Filter as well.

INTERNAL ONLY Copyright 2013 Tableau Software

7. Drag Region Filter to the filter shelf and set it


to true on both worksheets (Superstore,
Coffee Chain)

8. Travel back to the Filtering Across DBs


dashboard and select the drop down menu in
the top right hand corner of the Superstore
sheet.

9. Then select Parameters>Choose Region

INTERNAL ONLY Copyright 2013 Tableau Software

Click Steps

Screenshots

Example 6: Conditional Filter


1. Right click Customer Name on the rows
shelf and select Filter.

2. Click the Condition tab and select By


Formula. (clicking the button will open
the larger calculated field window)

3. Type: MAX(IIF(YEAR([Order Date])=2010,1,0))


+
MAX(IIF(YEAR([Order Date])=2011,1,0))
+
MAX(IIF(YEAR([Order Date])=2009,3,0))
+
MAX(IIF(YEAR([Order Date])=2012,3,0))
=2

4. Click OK in both windows

INTERNAL ONLY Copyright 2013 Tableau Software

Click Steps

Screenshots

Example 7: Customer History


1. Right click Customer Name on the rows
shelf and select Create set

2. Click the condition tab and formula button as


we did in the previous example.

3.

Type: MAX(MONTH( [Purchase History]) )=


MONTH(today())
AND
MAX(YEAR([Purchase History]))=YEAR(today())

4. Name the set Customers This Month

5. Replace Customer Name on the row shelf


with the set Customers This Month.

6. OPTIONAL: Drag Product Name to the row


shelf

10

INTERNAL ONLY Copyright 2013 Tableau Software

7. Drag Purchase History to the Filter shelf and


select the relative date filter or range of date
filter.

8. Adjust your Date filter to the last six months

11

INTERNAL ONLY Copyright 2013 Tableau Software

Click Steps

Screenshots

12

INTERNAL ONLY Copyright 2013 Tableau Software

Example 9: Dynamic Hide


1. Right click the whitespace in the dimension
window and select Create Parameter

2. Name this parameter Select Year and make


it a string data type.

3. Enter 2009-2012 in the list. Than select OK.

4. Right click the white space in the dimension


window again and select Create a Calculated
Field.

5. Name this calculation Year Filter and type


this into the window: YEAR([Order Date]) =
[Select Year] OR YEAR([Order Date])=[Select
Year]-1.

13

INTERNAL ONLY Copyright 2013 Tableau Software

6. Place Year Filter on the filter shelf and set it


to True

7. Right click the Select Year parameter in the


bottom left corner of the screen and select
Show Parameter Control

8. Filter out the nulls by selecting the bull option


in the bottom right hand corner of the view.

9. The select Filter Data.

14

INTERNAL ONLY Copyright 2013 Tableau Software

Click Steps

Screenshots

Example 10: Action Filter


1. On the High Level Dashboard, go to the
Dashboard menu on the toolbar at the top
and then select Actions

2. Then select Add Action > Filter

3. Change the Target Sheet to the Lower Level


Dashboard

4. Change Run action on: to Select and


Clearing the selection will: to Show All
Values

5. Then select OK and click away!

6. Hint: if you want the Top 15 products to work


correctly on the lower lever dashboard travel
back to that sheet and set the Action filter to
context!

15

INTERNAL ONLY Copyright 2013 Tableau Software

16

INTERNAL ONLY Copyright 2013 Tableau Software

Вам также может понравиться