Building Pivot in Tableau: 4 Easy Methods (2023)

Data Pivoting is an essential part of data processing and Business Intelligence as it enables you to rearrange your data by summarizing it, helping you to sort out required data in little or no time, group the data, find total or average from the data easily, etc. so you can get a different perspective from your data. This is done using Pivot tables as you can transform your data from rows into columns or columns into rows, as well as group them by fields, and use them for advanced calculations.

Table of Contents

This article aims at introducing you to Pivot in Tableau and showing you how to build Pivot in Tableau through four different methods.

Table of Contents

  • Understanding Tableau
  • Understanding Pivots
  • Prerequisites
  • Methods for Building Data Pivot in Tableau
    • Method 1: Pivots Columns to Rows
    • Method 2: Using Wildcard Search to Pivot
    • Method 3: Pivot Rows to Columns
    • Method 4: Using Custom SQL
  • Conclusion

Understanding Tableau

Building Pivot in Tableau: 4 Easy Methods (1)

Tableau is a Business Intelligence software that allows organizations from all around the world to derive insights from their data and build interactive visualizations. Tableau is famous for its intuitive visualizations and its capability to enable users without much technical background, exploit advanced analytical features. Tableau is available as a fully managed Cloud-based service called Tableau online and as an on-premise server-based deployment called Tableau Server.

(Video) Tableau Quick Tip - 3 ways to Pivot in Tableau Desktop | Tableau Tutorial | sqlbelle

Tableau also houses a large number of supporting applications to help the users make the best use of Tableau Server and Tableau Online. Tableau Prep builder assists you to connect to multiple data sources and prepare the data for analysis through calculated fields and cleansing. Tableau Prep conductor will also assist you in scheduling jobs for Dashboards and Reports, monitoring them, and provide debugging information. Official Documentation of Tableau can be found in the official documentation.

Understanding Pivots

A Pivot table by definition can be described as a statistical table that summarizes data from a more extensive table such as a database, spreadsheet, or even a business intelligence program to draw useful insights by arranging and rearranging them to a required format. Pivoting data has become an integral part of data analysis and the Pivoted data ultimately leads you to find figures and facts quickly, thereby, leading individuals and organizations to make informed decisions.

Prerequisites

To build a data pivot in Tableau you need the following:

  • Working knowledge of Tableau
  • Tableau account

Methods for Building Data Pivot in Tableau

Building Pivot in Tableau is easy and convenient depending on your aim and requirements for creating one. Tableau’s major objective is organizing your data into a nicely fitted arrangement so you can derive insights and come up with efficient analysis of your data to better your business processes.

Pivot is one such feature in Tableau as you can use it to streamline your data into rows or columns that will make for easy deductions and conclusions from them. Tableau has this affinity of making your data ‘tall’ rather than ‘wide’ as opposed to other platforms therefore, the preferred data Pivot in Tableau is gotten from columns to rows.

There are however four ways to building Pivot in Tableau which will be discussed elaborately in upcoming chapters, they include:

(Video) Tableau Prep Builder: Pivot / Transformations (Part 6 of 7)

  • Pivot Columns to Rows.
  • Using Wildcard Search to Pivot.
  • Pivot Rows to Columns.
  • Using Custom SQL.

Using any of the above methods will lead to a proper evaluation of your data and you can interact directly with the results, perform any additional cleaning operations on your data for maximum results.

Simplify your Data Analysis with Hevo’s No-code Data Pipelines

Hevo, a No-code Data Pipeline helps to transfer your data from 100+ data sources to the Data Warehouse or destination of your choice such as Tableau. Hevo is fully managed and completely automates the process of not only loading data from your desired source but also takes care of transforming it into an analysis-ready form without having to write a single line of code. Its fault-tolerant architecture ensures that the data is handled in a secure, consistent manner with zero data loss.

It provides a consistent & reliable solution to manage data in real-time and ensures that you always have analysis-ready data in your desired destination. It allows you to focus on key business needs and perform insightful analysis using a BI tool of your choice such as Tableau.

Check out Some of the Cool Features of Hevo:

(Video) How to Pivot Data in Tableau

  • Completely Automated:The Hevo platform can be set up in just a few minutes and requires minimal maintenance.
  • Real-Time Data Transfer:Hevo provides real-time data migration, so you can have analysis-ready data always.
  • 100% Complete & Accurate Data Transfer:Hevo’s robust infrastructure ensures reliable data transfer with zero data loss.
  • Scalable Infrastructure:Hevo has in-built integrations for100+ sourcesthat can help you scale your data infrastructure as required.
  • 24/7 Live Support:The Hevo team is available round the clock to extend exceptional support to you through chat, email, and support calls.
  • Schema Management:Hevo takes away the tedious task of schema management & automatically detects the schema of incoming data and maps it to the destination schema.
  • Live Monitoring:Hevo allows you to monitor the data flow so you can check where your data is at a particular point in time.

You can try Hevo for free by signing up for a14-day free trial.

Method 1: Pivot Columns to Rows

This method is best suited when you want to transform your data from wide to tall, you simply Pivot it from columns to rows on one or more groups of fields. As stated in the previous chapter this is the most preferable Pivot in Tableau as sometimes, analyzing data stored in a crosstab format can be difficult in Tableau therefore select the fields that you want to work with and Pivot the data from columns to rows.

Building Pivot in Tableau: 4 Easy Methods (2)

To Pivot columns to rows, do the following:

  1. Connect to your data source.
  2. Drag the table that is to be Pivoted to the Flow pane.
  3. Click on the plus icon and select Add Pivot from the context menu.
  4. Enter a value in the Search field in the Fields pane. This is used to search the field list for fields to Pivot in Tableau and it is an optional step.
  5. Check the Automatically rename Pivoted fields and values check box to enable Tableau Prep to rename the newly Pivoted fields using common values in the data. This is also an optional step.
  6. Select one or more fields from the left pane and drag them to the Pivot1 Values column in the Pivoted Fields pane.
  7. In the Pivoted Fields pane, you can add more columns to Pivot in Tableau by clicking on the plus icon. This is optional as you may not want to add more fields for all your analysis but should you add more, repeat the previous step to select more fields to Pivot.
  8. If you did not enable the default naming option, or Tableau prep did not automatically detect a name, edit the names of the fields and names of the original fields to best describe the data.
  9. You can rename the new Pivot step to keep track of changes if you wish as this is optional.
  10. Run the flow to refresh your Pivot in Tableau data changes.

Note: If you are using Tableau Prep Builder’s latest versions and on the web, in step 3 right-click on the fields you want to Pivot in Tableau that can be found in the Profile pane and select Pivot Columns to Rows from the menu then skip to step 7.

Method 2: Using Wildcard Search to Pivot

When working with large data sets or when your data frequently changes over time, you can use wildcard search to Pivot your data from columns to rows instantly based on a wildcard pattern match though this is currently available for Tableau Prep Builder’s latest versions and on the web.

Tableau Prep does this by detecting schema changes like addition and removal of new fields that match the pattern when the flow is run and the Pivot results are automatically updated.

(Video) Learn Pivot Tables in 6 Minutes (Microsoft Excel)

To achieve this, do the following:

  1. Connect to your data source.
  2. Drag the table that you want to Pivot to the Flow pane.
  3. Click on the plus icon and select Add Pivot from the context menu.
  4. Click on the link Use wildcard search to Pivot in the Pivoted Fields pane.
Building Pivot in Tableau: 4 Easy Methods (3)
  1. Enter a value or partial value you want to search for. You can use the Search Options button to select how you want to match the value then press Enter to apply the search.
  2. In the Pivoted Fields pane, click on the plus icon to add more columns to Pivot in Tableau. This is optional as you may not want to add more columns but if you do, repeat the previous step to select more fields to Pivot in Tableau.
  3. Edit the names of the fields if you did not enable the default naming option or if Tableau Prep could not automatically detect a name.
  4. Run the flow to refresh your Pivot data changes. Any new field added to your data source that matches the wildcard pattern will be detected and automatically added to the Pivot in Tableau.

Method 3: Pivot Rows to Columns

You can also create a Pivot in Tableau from rows to columns as this is done on Tableau Prep Builder’s latest versions and the web especially if you want to create new columns to enable a different visualization of your data.

Building Pivot in Tableau: 4 Easy Methods (4)

To do this, carry out the steps listed below:

  1. Connect to your data source.
  2. Drag the table that is to be Pivoted to the Flow pane
  3. Click on the plus icon and select Add Pivot from the context menu.
  4. Select Rows to Columns from the drop-down menu in the Pivoted Fields pane.
  5. Enter a value in the Search field using the Fields pane to search the field list for fields to Pivot in Tableau. This is an optional step.
  6. From the left pane, select a field and drag it to the Field that will Pivot rows to columns section in the Pivoted Fields pane. The values in this field will be used to create names and new columns.
  7. From the left pane, select a field and drag it to the Field to aggregate for new columns section in the Pivoted Fields pane. You can change the aggregate type from the default assigned value by clicking on aggregation type.
  8. Review the result in the Pivot Results pane and apply any cleaning operations to the newly created columns.
  9. Right-click on the Pivot step in the flow pane and select Refresh to refresh your data when changes occur in its row data.

Method 4: Using Custom SQL

You can also create Pivots in Tableau using the custom SQL feature provided by Tableau. The UNION ALL operator in a custom SQL query takes values from distinct columns and puts them into a new column.

To create Pivot in Tableau for your data using this custom SQL, do the following:

  1. Connect to your data source.
  2. In the left pane, Double-click the New Custom SQL option.
  3. Copy and paste the following custom SQL query and replace the contents with information about your table in the Edit Custom SQL dialog box:
Select [Static Column] , 'New Value (from Column Header 1)' as [New Column Header] , [Pivot Column Values 1] as [New Values] From [Table] Union ALL Select [Static Column] , 'New Value (from Column Header 2' as [New Column Header] , [Pivot Column Values 2] as [New Values] From [Table] Union ALL Select [Static Column] , 'New Value (from Column Header 3' as [New Column Header] , [Pivot Column Values 3] as [New Values] From [Table]
  • Static Column: This is a comma-delimited list of the columns from the table that should not be included in the Pivot in Tableau.
  • New Value: These are the new names 1 – 3 that you will give to the original column headers which will be used as row values in the Pivot.
  • Pivot Column Values: This refers to the columns whose values will be Pivoted into a single column from 1 – 3.
  • New Column Header: The name given to the new column that contains the new row values from New Value 1 – 3.
  • New Values: The name given to the new column that contains the original values from Pivot in Tableau Column Values 1 – 3.
  • Table: The table you connected to.
  1. Click OK

Conclusion

Building Pivot in Tableau is an avenue where you can dissect your bulky data into sections to enable you to get a better understanding of them and to come up with remedies and solutions where needed.

(Video) Pivoting data in Tableau Prep

This article has thrown light on how to build Pivot in Tableau for your data using four basic procedures which are Pivot Columns to Rows, Using Wildcard Search to Pivot, Pivot Rows to Columns, and Using Custom SQL. It provided steps on how you can achieve this and accompanying explanations for each step.

However, Pivots in Tableau can be built easily for analysis and interpretation using Hevo Data as a third-party platform to Tableau. Hevo is a No-code Data Pipeline and has awesome 100+ pre-built integrations that you can choose from. Hevo can help you integrate your data from numerous sources and load them into a destination to analyze real-time data with a BI tool such as Tableau. It will make your life easier and data migration hassle-free. It is user-friendly, reliable, and secure. Check out the pricing details here. Try Hevo by signing up for a 14-day free trial and see the difference!

FAQs

What are the four 4 components of a pivot table? ›

A pivot table is based on these four quadrants:
  • Filters.
  • Columns.
  • Rows.
  • Values.

How do you make a pivot in Tableau? ›

Pivot the data

Click the drop-down arrow next to the column name, and then select Pivot. New columns called "Pivot field names" and "Pivot field values" are created and added to the data source. The new columns replace the original columns that you selected to create the pivot.

Which four areas we use to create and manipulate pivot table? ›

At the bottom are the four areas of a PivotTable; the fields can be added to: ROWS, COLUMNS, VALUES, and FILTERS.

What are the 3 steps to creating PivotTables? ›

Create a PivotTable in Excel for Windows
  1. Select the cells you want to create a PivotTable from. ...
  2. Select Insert > PivotTable.
  3. This will create a PivotTable based on an existing table or range. ...
  4. Choose where you want the PivotTable report to be placed. ...
  5. Click OK.

What is the basic data structure for a pivot table? ›

A pivot table usually consists of row, column, and data fields. In this example, the rows are organized by Month Name and City. The columns are organized by Campaign, and the data are the Resulting Sales and Profit figures for each campaign.

How do I make a simple pivot chart? ›

Create a PivotTable if you don't have one already. Select any cell within the PivotTable. On the Insert tab, click a button to insert either a column, line, pie, or radar chart.
...
Create a chart from a PivotTable
  1. Select a cell in your table.
  2. Select PivotTable Tools > Analyze > PivotChart.
  3. Select a chart.
  4. Select OK.

How do I create an interactive pivot? ›

A pivot table can be created by selecting the whole data range, navigating to the Insert tab, and then the PivotTable option on the left. Now, let's create a line plot or Pivot chart for this pivot table. Select the whole pivot table, navigate to the Insert tab and click on the charts option arrow.

How do I create multiple pivots in Tableau? ›

Select one or more fields from the left pane and drag them to the Pivot1 Values column in the Pivoted Fields pane. To add more columns to pivot on, click the plus icon in the Pivoted Fields pane in Tableau Prep Builder then repeat the previous step to select more fields to pivot.

What are the different types of layouts we can use in a pivot? ›

Pivot Tables have three different layouts that you can choose from: Compact, Outline and Tabular Form.

How can you most easily create a PivotTable from external data? ›

Create a PivotTable with an external data source
  1. Click any cell on the worksheet.
  2. Click Insert > PivotTable.
  3. In the Create PivotTable dialog box, click From External Data Source.
  4. Click Choose Connection.

How many types of pivot tables are there *? ›

Pivot Tables have three different layouts that you can choose from: Compact, Outline, and Tabular Form.

What to do before creating a PivotTable? ›

Here are the 3 preparation steps that I recommend you follow, before building your first few pivot tables.
  1. Check the Source Data.
  2. Set a Goal.
  3. Think About the Layout.
Nov 10, 2022

Which 3 report formats for pivot tables are available? ›

Compact, Tabular, and Outline Report Formats

If you're working with data in Excel and are using a pivot table (Insert > Pivot Table), you can apply specific formatting styles to create different results.

What PivotTable option can you use to create an easy way for users to filter the data? ›

Create a slicer to filter data in a PivotTable
  • Click anywhere in the PivotTable.
  • On the PivotTable tab, select Insert Slicer.
  • In the Insert Slicers dialog box, select the check boxes for the fields you want to display, then select OK.
  • A slicer will be created for every field that you selected.

What is the easiest way to Analyse data in a PivotTable? ›

Here's an example containing some data about a hypothetical sales team.
  1. Select the Data You Want to Analyze.
  2. Choose “Pivot Table” from the “Insert” Tab.
  3. Select the Data You Want to Add to Your Table.
  4. Open the New Worksheet Tab.
  5. Choose the Fields for Your Pivot Table.
  6. Drag the Fields to the Desired Area.
  7. Change the Value Field.

How do I format a pivot table layout? ›

Change the style of your PivotTable
  1. Click anywhere in the PivotTable to show the PivotTable Tools on the ribbon.
  2. Click Design, and then click the More button in the PivotTable Styles gallery to see all available styles.
  3. Pick the style you want to use.
  4. If you don't see a style you like, you can create your own.

How do you categorize data in a pivot table? ›

Group or ungroup data in a PivotTable
  1. In the PivotTable, right-click a value and select Group.
  2. In the Grouping box, select Starting at and Ending at checkboxes, and edit the values if needed.
  3. Under By, select a time period. For numerical fields, enter a number that specifies the interval for each group.
  4. Select OK.

How do I create a PivotTable without calculations? ›

Inside the Pivot Column dialog, select the column with the values that will populate the new columns to be created. In this case "Time" but could be any field type, including text. In the Advanced Options part, select "Don´t Aggregate" so the values will displayed without any modification.

What is the difference between PivotTable and pivot chart? ›

You can use a PivotTable to summarize, analyze, explore, and present summary data. PivotCharts complement PivotTables by adding visualizations to the summary data in a PivotTable, and allow you to easily see comparisons, patterns, and trends.

How do I create a PivotTable combo chart? ›

Click anywhere in the chart you want to change to a combo chart to show the CHART TOOLS. Click DESIGN > Change Chart Type. On the All Charts tab, choose Combo, and then pick the Clustered Column - Line on Secondary Axis chart.

Can you have multiple pivots on one sheet? ›

When you have two or more pivot tables on the same worksheet, be careful to prevent them from overlapping. Before you add new fields to the pivot table on the left, you might have to add blank columns between the pivot tables. Or, if one pivot table is above the other, add blank rows between them.

Can we have multiple pivot tables in one function? ›

Yes, that's right. Let's say you are working on a dashboard where you are using multiple pivot tables. If you are able to connect a slicer to all the pivot tables you can control the entire dashboard with a single slicer. In the above example, we have a single slicer to control both of the pivot tables.

What are the three basic layouts? ›

There are mainly three types of layout: 1. Product or Line Layout 2. Process Layout 3. Combination of Product and Line Layouts.

How do I automate a PivotTable in Excel? ›

How to Automatically Create Pivot Tables in Excel
  1. Open the Excel VBA Coding Editor. ...
  2. Declare Variables. ...
  3. Suppress Warnings and Messages. ...
  4. Delete Any Existing Pivot Sheets. ...
  5. Define Data Source and Pivot Sheets. ...
  6. Identify the Last Used Row and Column. ...
  7. Create a Pivot Cache and a Pivot Table. ...
  8. Insert Rows, Columns, Filters, and Values.
Oct 13, 2022

How do I make a PivotTable automatically include new data? ›

Refresh data automatically when opening the workbook
  1. Click anywhere in the PivotTable to show the PivotTable Tools on the ribbon.
  2. Click Analyze > Options.
  3. On the Data tab, check the Refresh data when opening the file box.

What are the most useful pivot table functions? ›

A Pivot Table is used to summarise, sort, reorganise, group, count, total or average data stored in a table. It allows us to transform columns into rows and rows into columns. It allows grouping by any field (column), and using advanced calculations on them.

What is the best use for pivot tables? ›

Use a pivot table to build a list of unique values. Because pivot tables summarize data, they can be used to find unique values in a field. This is a good way to quickly see all the values that appear in a field and also find typos, and other inconsistencies.

How many values can a pivot table handle? ›

PivotTable and PivotChart report specifications and limits
FeatureMaximum limit
Value fields in a PivotTable report256
Calculated item formulas in a PivotTable reportLimited by available memory
Report filters in a PivotChart report256 (may be limited by available memory)
Value fields in a PivotChart report256
8 more rows

How many columns do you need to make a PivotTable? ›

Column structure in order to create a Pivot Table in Excel. In order to create a Pivot Table, you need a structure as shown on the right hand side. Each column contains one data type. As you have 4 different data fields (product, type (revenue or cost), year and the values) you need 4 columns, one for each data type.

What is the shortcut for PivotTable? ›

To insert a new pivot table, simply select any cell in your data set and press the shortcut keys ALT + N + V.

What is the difference between filter and slicer? ›

Slicers are visualizations on a Power BI canvas that allows users to refine the data for themselves easily. Filters are for developers to refine specific visuals, entire pages, or whole workbooks before sharing the dashboard(s) with end-users.

What is the difference between a filter and a slicer in a PivotTable? ›

Filters are locked to columns and rows. Slicers are floating objects and can be moved anywhere. For example, you can put a slicer next to your pivot chart or even within the chart area and have the chart contents updated in real time on a button click.

How many types of pivot table are there in Excel? ›

Pivot Tables have three different layouts that you can choose from: Compact, Outline, and Tabular Form.

What are the pivot table fields? ›

PivotTable Fields is a Task Pane associated with a PivotTable. The PivotTable Fields Task Pane comprises of Fields and Areas. By default, the Task Pane appears at the right side of the window with Fields displayed above Areas. Fields represent the columns in your data – range or Excel table, and will have check boxes.

What are the pivot table tools in Excel? ›

Pivot tables in Excel are an important tool used by many businesses. They are used to summarize, sort, reorganize, group, count, total or average data stored in a database. Users can transform columns into rows and rows into columns (hence the term “pivot table”).

How do I create a PivotTable for dummies? ›

How to Create a Pivot Table
  1. Enter your data into a range of rows and columns.
  2. Sort your data by a specific attribute.
  3. Highlight your cells to create your pivot table.
  4. Drag and drop a field into the "Row Labels" area.
  5. Drag and drop a field into the "Values" area.
  6. Fine-tune your calculations.
Feb 8, 2023

How do you summarize data in a PivotTable? ›

In the PivotTable, right-click the value field you want to change, and then click Summarize Values By. Click the summary function you want.

Why PivotTable is so powerful? ›

Pivot Tables are one of the most powerful features of Microsoft Excel. They allow you to analyze more than 1 million rows of data with just a few mouse clicks, show the results in an easy to read table, highlight key information to management and include graphs for your monthly presentations.

How many values can a PivotTable handle? ›

PivotTable and PivotChart report specifications and limits
FeatureMaximum limit
Value fields in a PivotTable report256
Calculated item formulas in a PivotTable reportLimited by available memory
Report filters in a PivotChart report256 (may be limited by available memory)
Value fields in a PivotChart report256
8 more rows

How many rows of data can a PivotTable handle? ›

You can create pivot tables with up to 500,000 records. You can add any combination of row and column field values that add up to 40. For example, if you have 10 row field values, then you can add up to 30 column field values. You can create pivot table calculations only on nonaggregated values.

What is the function of slicer? ›

Slicers provide buttons that you can click to filter tables, or PivotTables. In addition to quick filtering, slicers also indicate the current filtering state, which makes it easy to understand what exactly is currently displayed. You can use a slicer to filter data in a table or PivotTable with ease.

How do I filter data in a pivot chart? ›

In the PivotTable, select one or more items in the field that you want to filter by selection. Right-click an item in the selection, and then click Filter.

What is the shortcut key for PivotTable? ›

To insert a new pivot table, simply select any cell in your data set and press the shortcut keys ALT + N + V.

What is VLOOKUP used for? ›

Use VLOOKUP when you need to find things in a table or a range by row. For example, look up a price of an automotive part by the part number, or find an employee name based on their employee ID.

What is the difference between a PivotTable and a pivot chart? ›

The data in a PivotTable can “pivot” from row to column and switch back again in a few easy clicks of the mouse. This is where the name PivotTable comes from. A PivotChart is created based on a PivotTable and is a graphical representation.

Videos

1. Tableau - Pivot Data From Rows To Columns
(Jared Rentz)
2. Tableau in Two Minutes - How to Pivot Data in the Data Source
(Penguin Analytics)
3. Tableau Tutorial | Transforming Pivot Data into Simple (Flattened) Data
(Abhishek Agarrwal)
4. Simplex Method Tabular Form 01
(GOAL PROJECT)
5. Tableau Tutorial - Pivot Columns to Rows (or UnPivot)
(Weston Palmer)
6. How to in Tableau Prep in 5 mins: Pivot from Columns to Rows
(The Information Lab)
Top Articles
Latest Posts
Article information

Author: Merrill Bechtelar CPA

Last Updated: 03/12/2023

Views: 5565

Rating: 5 / 5 (50 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Merrill Bechtelar CPA

Birthday: 1996-05-19

Address: Apt. 114 873 White Lodge, Libbyfurt, CA 93006

Phone: +5983010455207

Job: Legacy Representative

Hobby: Blacksmithing, Urban exploration, Sudoku, Slacklining, Creative writing, Community, Letterboxing

Introduction: My name is Merrill Bechtelar CPA, I am a clean, agreeable, glorious, magnificent, witty, enchanting, comfortable person who loves writing and wants to share my knowledge and understanding with you.