Unpivot

Supported in: Batch, Streaming

Performs the opposite of pivot...

Transform categories: Aggregate, Popular

Declared arguments

  • Columns to unpivot - List of columns to unpivot.
    List<Column<T>>
  • Dataset - Dataset to perform unpivot on.
    Table
  • Output unpivoted column name - Column name given to the output column that contains the unpivoted columns.
    Literal<String>
  • Unpivoted values output column name - Column name given to the output column that contains the unpivoted values.
    Literal<String>

Type variable bounds: T accepts AnyType

Examples

Example 1: Base case

Argument values:

  • Columns to unpivot: [new_york_miles, london_miles]
  • Dataset: ri.foundry.main.dataset.a
  • Output unpivoted column name: city
  • Unpivoted values output column name: miles

Input:

airlinenew_york_mileslondon_miles
foundry airways10006000
new airnull8000

Output:

citymilesairline
new_york_miles1000foundry airways
london_miles6000foundry airways
new_york_milesnullnew air
london_miles8000new air