KNOWLEDGE BASE

Pivot Calculated Fields


Published: 15 Oct 2018
Last Modified Date: 16 Oct 2018

Question

How to pivot on calculated fields, including split fields

Environment

  • Tableau Prep

Answer

The attached "split then pivot prep flow.tfl" demonstrates the following directions:
  1. Open Tableau Prep and connect to the original data source
  2. Hover over Original Data, click the plus (+), and select Add Step
  3. In Clean 1, right-click the field containing the list of values, this example uses [Pet Name], and select Split Values > Custom Split
  4. In the Custom Split dialog, do the following:
    • Enter the separator, which is ,
    • For Split off, select All
    • Click Split
  5. Hover over Clean 1, click the plus (+), and select Add Pivot
  6. Drag [Pet Name - Split 1], [Pet Name - Split 2], and [Pet Name - Split 3] to the Pivot1 Values column
  7. Hover over Pivot 1, click the plus (+), and select Add Output
  8. In Output, run the flow

Additional Information

The ability to pivot on calculated fields is only included in Tableau Prep. If it is not possible to use Tableau Prep, then it may still be possible to build the desired view without pivoting the calculated fields. See Creating Views When Data is Formatted as Text Lists
Did this article resolve the issue?