Reshaping Data with Advanced Techniques
When working with data, we sometimes find that we need to reshape it in order for it to be useful for storing in a table or to use that data for reporting purposes, and to do that, we transpose data by either moving columns to rows (or vice versa) and/or storing data in a hierarchical structure.
In this chapter, you will learn three advanced ways of reshaping data—PIVOT
, UNPIVOT
, and hierarchies, to manipulate data into meaningful output.
We will cover each topic in three main sections:
- Working with the
PIVOT
operator - Working with the
UNPIVOT
operator - Understanding hierarchical data