How to Auto Generate Views in Different Languages Using Tableau Server

When sharing workbooks with a variety of audiences, it may be necessary to display the content of the view in the language appropriate for a particular audience. To be able to display the content of the view dynamically like this, your data source must contain fields that are specific to a language. Then, you can create a calculation that will only display a particular field in the view depending on the Tableau Server group that a user is accessing the workbook belongs to.

Create language groups and add users

For this example, you will need to create three groups and three users, and then add one user to each group. Each group will represent the language that you want to dynamically display language specific fields for the users of that group.

Step 1

Log in to Tableau Server with your administrator username and password.

Step 2

Under the Admin tab, click Groups.
For Tableau Server 7.0 and earlier, click Administration, click Groups.

Step 3

Click New.
For Tableau Server 7.0 and earlier, below the list, click Create New Local Group or Add New Group.

Step 4

In the Name text box, type German, and then click Add Group.

Step 5

Repeat steps 3 and 4, to create a group called "French" and a group called "Chinese".

Step 6

Under Admin, click Users.

Step 7

Click Add.

Step 8

In the Username text box, type the user's name, and then click Next. In this example, the user Fred Fischer's username is "ffischer".

Step 9

Complete the required information, and then click the Add button.

Step 10

Repeat steps 8 and 9 to add a username "mmichaud" for Marie Michaud,  and "wwong" for Wayne Wong.

Step 11

Under Admin, click Users.

Step 12

Select the check box for Fred Fischer, click Group +, and then select German from the list.

Step 13

Repeat step 12 to add Marie Michaud to the French group, and Wayne Wong to the Chinese group.

Connect to the data

This example uses a modified version of the Sample - Superstore data source. This data source contains five worksheets: Orders, Returns, Users, language, and language2. The language and language2 worksheets list the items in the Product 2 - Sub-Category and Customer Segment in English, German, French, and Chinese.

Step 1 

Connect to the attached data source.

Step 2

In the Excel Workbook Connection dialog box, under Step 2, select Orders, and then select Multiple Tables.

Step 3

Click the Add Table button.

Step 4

In the Add Table dialog box, select language.

Step 5

Under Table Fields, in the Field Alias column, double-click the Chinese field alias, and type Product Sub-Category (ch).

Step 6

Click the Join tab.

Step 7

On the Join tab, under Add Join Clause, in the Schema Fields list, select Product Sub-Category.

Step 8

In the Table Fields list, select Product 2 - Sub-Category.

Step 9

In the operator list, keep the equals sign, and click Add button.

Step 10

In the Join Type list, select Left. A left join returns all rows from the left table, even if there are no matches in the right table.

Step 11

When finished, click OK. In the Excel Workbook Connection dialog box, the language table is now listed.

Step 12

In the Excel Workbook Connection dialog box, click Add New Table.

Step 13

In the Add Table dialog box, under Select the table to join, select language2.

Step 14

Under Table Fields, in the Field Alias column, double-click the Chinese field alias and type customer segment (ch), and then click outside the field.

Step 15

Click the Join tab.
The suggested join that appears at the top of the tab is correct. All you need to do is select the join type.

Step 16

In the Join Type list, select Left, and then click OK.
In the Excel Workbook Connection dialog box, all three tables are listed.

Step 17

In the Excel Workbook Connection dialog box, click OK.

Create a calculated field to select the appropriate language from the product sub-category data

Step 1

Select Analysis > Create Calculated Field.

Step 2

In the Calculated Field dialog box, do the following tasks:
  1. In the Name text box, type Product Sub-Category Label.
  2. In the Formula text box, type the following, and then click OK.
IF ISMEMBEROF("German") THEN [Artikel 2 - Sub-Kategorie]
ELSEIF ISMEMBEROF("French") THEN [Produit 2 - Sous-catégorie]
ELSE [Product 2 - Sub-Category]
END
 

Create a calculated field to select the appropriate language from the customer segment data

Step 1

Select Analysis > Create Calculated Field.

Step 2

In the Calculated Field dialog box, do the following tasks:
  1. In the Name text box, type Customer Segment Label.
  2. In the Formula text box, type the following, and then click OK.
IF ISMEMBEROF("German") THEN [Kundensegment]
ELSEIF ISMEMBEROF("French") THEN [Customer Segment (fr)]
ELSEIF ISMEMBEROF("Chinese") THEN [customer segment (ch)]
ELSE [Customer Segment]
END

 

Create a worksheet

You use the calculated fields that you created above (i.e., Product Sub Category and Customer Segment) instead of the language-specific fields.

Step 1

From the Dimensions pane, drag Customer Segment Label field to the Columns shelf, and Product Sub Category Label field to the Rows shelf.

Step 2

From the Dimensions pane, drag Measure Names onto the Columns and Filters shelves.

Step 3

In the Filter dialog box, clear the check boxes for all measures except those for ProfitSales, and Shipping Cost, and then click OK.

Step 4

From the Measures pane, drag Measure Values to Text.

Step 5

On the Measure Values shelf, right-click Profit, and select Measure > Average.

Step 7

Right-click the worksheet tab, select Rename Sheet, and then type Four Languages.

Step 8

Save the workbook as Auto-Generate Languages.
 

Publish the workbook

Step 1

Select Server > Publish Workbook.

Step 2

In the Publish Workbook to Tableau Server dialog box, under Views to Share, select the check box for Four Languages.

Step 3

In the Generate Thumbnails as User list, select All Users, and then click the Publish button.

Step 4

In the Publish Workbook Results window, select Open in browser window.

Step 5

If the Login screen opens, log in to Tableau Server.
After logging in to Tableau Server, make note that the content of the view displays in English.

Step 6

Log out of Tableau Server and log in again as one of the users you added. For example, log in as Marie Michaud.

Step 7

Locate and click the Four Languages workbook. The content of the view for Product Sub Category and Customer Segment fields is displayed in French.