We’re looking to migrate from traditional SQL transformation scripts to dbt.
Right now, the beginning of every transformation looks something like this:
ALTER SESSION SET QUERY_TAG = 'description of transformation that follows our convention'; SET TOMORROW = DATEADD(DAY, 1, CURRENT_DATE)::DATE; SET CURRENT_DATETIME_PACIFIC = CONVERT_TIMEZONE('America/Los_Angeles', CURRENT_TIMESTAMP); SET DATETIME_LATEST_RUN = (SELECT ...);
I’ve seen that I can put one item in “sql_header”, and that I can declare project-wide variables.
I’d probably put the TOMORROW variable somewhere central and perhaps others, but, with Snowflake:
- is it possible to declare more than one model-specific variable?
- is it possible to use a variable in the calculation of another in dbt_project.yml
- is it possible to make a variable dynamic in dbt_project.yml (ideally, using SQL)?