Backend – Tableau Desktop

Table of Contents

1. Login

(1) Premise

(2) Connect to the server

2. Obtain data sources

3. Make a worksheet

(1) Columns and columns

1. “Column”

2. “Column”

3. Classic examples

(1) Make data tables

(2) Make data graphs

(2) Dimensions and measures

1. Dimensions are used for classification

2. Metrics are used to calculate

3. Attention

(3) Discrete and continuous

1. Discrete

2. continuous

3. Examples

(4) Customized field names and real field names

1. Customize field names

2. View the real field name

(5) Establish calculation fields/parameters and set the data display range

1. Create calculation fields (new field)

2. Create parameters

(1) Settings

(2) Function

(3) Custom SQL using newly created parameters

(6) Create serial number ID field

1. Create calculation fields

2. Find the calculation formula

3. Put the serial ID in “column”

4. Adjust data in other fields of the worksheet

(7) Set the text format of data

(8) Set the last column of the worksheet (“No measure value”)

(9) Create diagram

1. Merge multiple charts

2. Set label prompts

3. Display percentage

4. Set the bar chart data to be centered

(10) Date field

(11) Set worksheet size

4. Create a dashboard pane

(1) Add a new dashboard pane

(2) Display worksheet

(3) Set title

(4) Create filter box

(5) Create a search box

(6) Set the dashboard size

(7) Jump to the second-level report

(7) Number of dashboard panes

5. Release

1. Log in

2. Publish the workbook

3. Click “Publish”


1. Login

(1) Premise

Before using Tableau Desktop, operate Tableau Prep Builder to copy data. (To avoid affecting the data in the official library when using Tableau tools)

(2) Connect to the server

1. Select database type > Set server information.

2. If you do not have the database type you want, follow the official instructions to download the server driver, install and configure it.

2. Obtaining data sources

Data source > New custom SQL > Enter the SQL query statement > Click OK (start running) -> Click “Update Now” in the lower right corner of the work interface (check whether the data can be queried normally)

3. Make a worksheet

(1) Column and Column

1. “Column”

(1) Equivalent to the X abscissa.

(2) The “dimension” field is usually placed in the “column”.

2. “Column”

(1) Equivalent to the Y ordinate.

(2) The “measurement” field is usually placed in the “column”.

3. Classic example

(1) Make data table

The “Metric Name” field generated in the left navigation bar is placed in “Column”. Place the desired fields in “Column”.

(2) Make data graph

Place the required column for the abscissa in “column”. Place the required fields for the ordinate data in “Column”.

(2) Dimensions and Measures

1. Dimensions are used for classification

Refers to a field whose field values are string (text) and date. For example, age, region.

2. Measurement is used for calculation

Refers to a field whose value is numeric. For example, days, total, yield.

3. Note

When obtaining data sources, Tableau software generally automatically attributes string values to dimensions and numeric values to measures.

(3) Discrete and Continuous

1. Discrete

Quantities are limited and different (blue)

2. Continuous

Unlimited quantity (green)

3. Example

For a bar chart, the column field should be set to discrete; for a line chart, the column field should be set to continuous.

(4) Customized field name, real field name

1. Customized field name

Update the field name in Worksheet > Folder (for example, change the English name to Chinese name to make it easier for users to view).

Note: The order of the three fields in the hierarchy will affect the data display in the worksheet.

2. View the real field name

View the real database field name corresponding to the custom field name.

(5) Create calculation fields/parameters and set the data display range

1. Create a calculated field (new field)

For example: Create a calculation field for “Start Time” and set it to 7:30 in the morning.

If the end time is 7:30 the next morning, just TODAY() + 1.

2. Create parameters

(1) Settings

Do not use the default “current value” for “Value when the workbook is opened”, but use the calculation field you created. As shown below, select “Start Time”.

(2) Effect

Convenient to set filter conditions in the “Dashboard Pane”; used as query condition parameters of SQL statements.

(3) Customized SQL uses newly created parameters

Data source > New custom SQL > Modify the SQL query statement (limit the query range, for example: WHERE a.lasteventtime + INTERVAL ‘8’ hour BETWEEN AND in >) > Click OK > Click “Update Now”.

(6) Create serial number ID field

1. Create calculated fields

Create a “calculated field” for “Serial ID”.

2. Find the calculation formula

When editing, if you want to find a calculation formula, click the arrow enclosed in the red box below to search.

3. Put the serial number ID in the “column”

In “Column”, you will encounter a problem: the position order between this field and other fields cannot be adjusted, and the data you see is not numerical, but a continuous graph.

In order to solve this type of problem, right-click the column in “Column” and change “Continuous” to “Discrete”.

4. Adjust data in other fields of the worksheet

Under the influence of the ID serial number, in order for the data in other fields to be displayed normally, all fields need to be checked in the “Edit Table Calculation”.

(7) Set the text format of the data

Right-click anywhere on the worksheet > Format > The format pane will appear in the left navigation bar (if you want to close this pane, click the small cross in the upper right corner of the pane).

(8) Set the last column of the worksheet (“no measure value”)

The situation is that when making the data table, only “Measurement Name” is placed in the “Column”, then there will be an invalid column as the last column. The default is “no metric”.

In order to avoid displaying invalid data in the last column when presenting data to users, you can perform the following operations.

1. Drag a field (“Field 1”) of “Folder” to “Text” in “Mark”. Then the mark of “Field 1” will be generated, and the last column will display the text data of “Field 1”.

2. Change the field name of the last column: right-click the field and click “Edit Alias”.

3. If there is a self-created serial ID in “Column”, you need to check this field (“Field 1”) in “Edit Table Calculation” (that is, ensure that all fields are checked) ).

(9) Create a picture

1. Merge multiple charts

Right-click on the last column in Columns > select Dual Axis.

2. Set label prompts

In “All” of “Marks” > click “Labels” > check “Show marker labels”.

3. Display percentage

Right-click on Measure > Format > Panes to set the number as a percentage.

4. Set the bar chart data to be centered

Right-click a field in “Column” > “Format” > “Align” and select “Center”.

(10) date field

By default, only “Year” is displayed in general fields. If you need to display a specific date, you need to right-click the date field in “Column” and select “Exact Date”.

After clicking “Exact Date”, it will change to “Continuous” status, so you need to click “Discrete” immediately below “Exact Date”.

If there is a self-created serial ID in “Column”, right-click in the ID field, reset the “Edit Table Calculation”, cancel the original red field, and select the newly generated date field.

(11) Set the worksheet size

“Fitness” in the “Toolbar” is changed from “Standard” to “Fit Width”.

4. Create dashboard pane

(1) Add a new dashboard pane

(2) Display worksheet

Drag the worksheet to the right position

(3) Set title

Select the text of “Object” and drag it to the worksheet on the right side of the pane.

The most commonly used objects: horizontal containers, vertical containers, text.

(4) Create filter box

1. Select the worksheet > click the third icon “arrow” > select “Filter Conditions” or “Parameters” to set the filter box.

(1) The filter box of “Filter Conditions” corresponds to the “Calculation Field”

There is no need to add conditions in the SQL query statement of the data source, which corresponds to the column fields of the database table.

(2) The filter box of “Parameter” corresponds to “Parameter”

Conditions need to be added to the SQL query statement of the data source, corresponding to the customized conditions in where, limit, etc.

2. If you select “Filter Conditions”, you must first add the required filter conditions in the “Worksheet”. The filter box generated in the “Dashboard Pane” can set the drop-down box presentation form.

3. If you select “Parameters”, the premise is to first create parameters in the “Worksheet” and supplement the where, limit and other conditions of the SQL statement in the SQL query of the data source.

1. Create parameters in the “Worksheet”.

2. Click the worksheet area in the “Dashboard Pane” > click the third icon “arrow” > select “Parameters” to create a search box.

3. Supplement the where condition of the SQL statement.

AND a.Field name in (SELECT regexp_split_to_table(<parameter.Parameter name 2>, ',') AS field name)

Notice:

PostgreSQL string separation function (query multiple entries): regexp_split_to_table (parameter 1, parameter 2), the parameter position 1 is the field, and the parameter position 2 is the comma. It means separating fields with commas.

For example: when querying, enter in the search box in the dashboard pane: field value 1, field value 2, field value 3, then the SQL statement in (SELECT regexp_split_to_table (field name, ‘,’) corresponds to is in (field value 1, field value 2, field value 3)

(6) Set the dashboard size

(7) Jump to the second-level report

1. Create a secondary report (another worksheet)

2. Worksheet > Action > Add filter condition

Notice:

(1) The meaning of filtering conditions

Understanding: When field name 1 and field name 2 are specified, when clicking a cell to jump to the secondary interface, only the fields consistent with “Click the column name 1 and field name 2 of the cell” will be displayed. All records.

That is, if the filter condition is all fields, only one piece of data can be found (that is, the record where the current cell is located).

(2) The function of the check box in the filter conditions: it is only used for the removal function.

(3) The fields of the filter conditions must exist in the secondary report.

3. Jump to the secondary report interface

In the worksheet of the dashboard pane, each cell can jump to the secondary report interface.

(7) Number of dashboard panes

Generally, you only need to create one dashboard pane (you can create multiple worksheets)

5. Release

After the report production is completed, the local report needs to be uploaded to the server.

1. Login

After successful login, close the online web page and return to the software.

2. Publish workbook

Select a “worksheet” in the bottom toolbar > click “Server” in the top toolbar > “Publish Workbook” > fill in the corresponding content

Click “Edit” in “Data Sources”: Change “Authentication” from “Prompt User” to “Embedded Password” (the purpose is to avoid entering a password when editing the workbook online)

3. Click “Publish”

The successfully published web page is then displayed.