O'Reilly logo

TIBCO Spotfire – A Comprehensive Primer by Michael Phillips

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Transforming data structure through pivots and unpivots

You can use pivot and unpivot transformations to change narrow tables into wide tables and vice versa. You can also use a pivot to permanently reduce the granularity of a data table by summing up to a higher level.

Take a look at the baseball player data. What sort of table do you think it is? It has columns for player name and team and then individual columns for a range of standard baseball statistics, with each statistic getting its own column. This was very convenient when we wanted to calculate the walk-to-strikeout ratio.

Unpivot

Let's see what happens when we unpivot the baseball player data table.

The data used here is BaseballPlayerData.xls, which you can download from http://www.insidespotfire.com ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required