SliceMixed / List Layer

Extract a contiguous subsequence from each variable-length list using dynamic offset and length values. Similar to Python's list slicing but with per-row control. Returns a new list containing the specified elements.

Example transformation:

listsoffsetlengthresult
[1, 2, 3, 4]12[2, 3]
[a, b, c]-22[b, c]
[x, y, z]01[x]
[q, r]10[r]

Common applications:

  • Dynamic window selection
  • Conditional sequence extraction
  • Variable-length history analysis
  • Adaptive time series processing
  • Flexible range selection
  • Context-dependent slicing

Note: Lists can have any length. Returns empty list if offset is out of bounds. Length is automatically adjusted if it extends beyond list bounds. Particularly useful for data-driven sequence analysis.

Table
0
0
Table

Select

column

The variable-length list column to slice. Examples:

  • Time series: [t1, t2, t3, t4]
  • User actions: [click1, click2, click3]
  • Transactions: [tx1, tx2] Lists can have different lengths. Supports any data type.

Offset

oneof
SelectOffset

Column containing starting positions. Each row can specify a different offset. Supports both positive and negative values.

Fixed starting position for all slices. Supports negative indexing.

Length

oneof
SelectLength

Column containing slice lengths. Each row can specify a different length. Use 0 to take all remaining elements.

Fixed number of elements to take for all slices. Use 0 to take all remaining elements.

Name for the new column. If not provided, the system generates a unique name. If AsColumn matches an existing column, the existing column is replaced. The name should follow valid column naming conventions.