Skip to main content


The PIVOT clause is useful for side-by-side comparison of data. In SQL Frames a Pivot DataFrame can be created from an existing Grouped DataFrame.

SQL Generation

The SQL PIVOT clause is severely lacking compared to the flexibility available in SQL Frames. Hence, currently the SQL transpilation is only for the associated Grouped DataFrame.

Hierarchical Pivot

Any DataFrame can be converted to a Hierarchical DataFrame including Pivot DataFrames. Just calling hdf() on an existing Pivot DataFrame, it is converted to a Hierarchical Pivot DataFrame. All the non-pivoted columns are automatically used to create the hierarchy.


Order By Pivot Columns

By default the pivot columns are ordered in ascending order of the pivot column fields. It is possbile to change the order using the vdf.sortColumns() API.


The orderBy API supports specifying sort on multiple columns