Version:

Input Var

Learn how to create and use input_var in your Profiles project.

An input_var adds a calculated column to an input table. It calculates a single value per row of the input table which can be used as an input for entity_vars.

- input_var:
    name: input_var_name
    select: SQL statement
    from: inputs/table
    window:
        partition_by:
            - partition_column
    description: description
FieldDescription
nameName of the input_var.
selectSQL state, equivalent to SELECT statement.
fromPath of the input table, equivalent to FROM statement.
whereFiltering condition, equivalent to WHERE statement.
windowAdds partition_by and/or order_by keys for window functions
descriptionDescription of the input_var.

Example

- input_var:
    name: page_count
    description: Adds column to a SQL model to get a page count per date.
    select: count(distinct url)
    from: models/pages_orderby_table
    window:
        partition_by:
            - profile_id
            - date

Questions? Contact us by email or on Slack