Give a chestnut! Tableau Tips (140): One-click cancel filter or just keep...

published: 2021-06-11

In daily business analysis, users often use waterfall charts to show the distribution and time changes of customer profit contributions (as shown below).

In the waterfall chart, you can use the category filter to view: the customer's annual profit contribution of a certain type of product. In addition, you can also view the annual profit contribution of a customer through the "reserve only" operation.

However, if you want to quickly check the overall data before filtering, or the contribution of other customers, the way to cancel the filtering or just keep it is always inconvenient.

Today, we share a little trick to set a small button of "one-click return", and the chart can be restored to all values in 1 second~

In this issue of "Give a Chestnut", the Tableau technique we want to share with you is: one-click cancel filter or just keep.

To facilitate learning, Lizi uses the "Sample-Supermarket" data source that comes with Tableau. After mastering the chestnut method, data fans can try to use their own data.

Specific steps are as follows:

Open Tableau Desktop, connect to the "Sample-Supermarket" data source, create a new worksheet, and name it "Waterfall Chart".

In order to better display the data, first format the metric "profit". Right-click the metric "Profit", select "Default Properties"-"Format" in the pop-up menu, select Custom in the pop-up dialog box, and type: #,##0,.0.

1、Create a set of "high-quality customers"

In the "Data" pane, right-click the dimension "Customer Name" and select "Create Set" from the drop-down menu. Then according to the following figure, in the pop-up "Create Set" dialog box to set related settings:

Name the set "Quality Customers", under the "Top" tab, check "By Field", then select "Top", "10", "Profit", "Sum", and click OK. Then drag and drop the set "Quality Customers" into the "Filter" card.

2、Create a "Waterfall Chart" worksheet

Drag and drop the dimensions "Order Date" and "Customer Name" to the column, and drag and drop the measure "Profit" to the row. Right-click the "Sum (Profit)" capsule on the column, and select "Quick Table Calculation"-"Summary" in the pop-up menu. In the "Marks" card, set the mark type to "Gantt Bar".

Drag and drop the metric "Profit" into the "Size" of the "Mark" card, double-click the "Sum (Profit)" capsule to enter the editing mode, and manually modify the function formula as: SUM(-[Profit]).

Drag and drop the measure "Profit" to the "Label" of the "Marks" card, and adjust the label format as needed.

Switch to the "Analysis" pane, drag and drop the "reference line" into the view, and select "area" in the pop-up selection box. As shown in the figure below, set the reference line and its format.

Drag and drop the "Total" in the "Analysis" pane into the view, and select "Sum of Rows" in the pop-up box. Results as shown below:

3、Create a "Category Filter" worksheet

Create a new worksheet and name it "Category Filter". Drag and drop the dimension "Category" into the "Text" of the "Columns" and "Marks" cards. By hiding the column headings and setting the text format, the following view is generated.

4、Create a "back button" worksheet

Create a new worksheet and name it "Back Button". Drag and drop the measurement "Number of Records" to the "Text" of the "Marks" card, select the mark type as "Shape", and then select the shape yourself, here it is "◆".

Click the "Label" card to enter the "Edit Label" dialog box, type: return all values, click OK, as shown in the figure below. Then adjust the font and alignment format of the label as needed.

5、Return all values with one click through filtering operation

Create a new dashboard and name it "Return all values". Drag and drop the completed 3 worksheets into the dashboard view. Select the "Category Filter" worksheet and click the "Funnel" button to use it as a filter.

Select the "Dashboard"-"Operation" command in the menu bar, and in the pop-up operation dialog box, select "Add Operation"-"Filter".

As shown in the figure below, name the filter "Return Value Operation", select "Back Button" in the source worksheet, and select "Select" for the operation mode; select "Waterfall" in the target worksheet, and select "Display" when clearing the selected content All values". Check the "Selected Fields" for the target filter, click the "Add Filter" button, select "Customer Name" and "Order Date" in the source field drop-down menu, and click OK.

In this way, the effect we want is successfully achieved~~

Tips:

Try not to apply all other filters to the worksheet that returns all values;

Clearing the selection will: display all values;

Select which table the return button acts on;

Which field you want to return all values needs to select which field, if there are multiple, multiple selected fields.

Today’s Tableau skills, have you got it yet?Give it a try!