A ViewColum object represents a column in a View object, which can undergo various transformations depending on its data type.
Generic transforms can be applied to any data type within a view. Find a list of generic transforms in the glossary.
Built-in arithmetic operators (+, -, *, /) can be used to manipulate numeric columns, as shown below:
Refer to the glossary for additional numeric transforms.
String columns can be concatenated directly:
Check the glossary for other String transforms.
Datetime columns can be transformed in various ways, such as calculating differences, adding time intervals, or extracting date components. The glossary provides a list of supported dateparts transforms.
Retrieve preceding values associated with a specific entity, using the
Lags transforms are only supported for Event and Change views.
Retrieve a UDF instance from the catalog using the
Get the user-defined function's metadata using the
Execute the function on any view column or feature with a compatible data type:
Apply if-then-else transforms by filtering rows through conditional statements.
Perform exploratory analysis on view columns, such as descriptive statistics, preview, and sample. These operations are executed after cleaning operations set at the table level or during view creation if created in manual mode.
# Obtain descriptive statistics for a view column
# Preview a selection of rows from the view column
df = invoice_view.Amount.preview(limit=20)
# Sample random rows from the view column based on a specified time range, size, and seed
df = invoice_view.sample(
to_timestamp=pd.Timestamp('2023-05-01'), size=100, seed=23
When extracting a ViewColumn from a View object, a copy of the original object is created. This can be assigned back to the view as a new column or used for further transformations.