Global models are models which can be included in workflows. This is helpful if you have multiple projects which should use the same transformation.
{{ block "CONFIG" .}}
{{end}}
{{ block "SELECT" .}}
{{ globalmodel "bla/blub" . }}
{{end}}
Create a folder bla in the global models folder:
mkdir globals/models/bla
No create a file called blub.le.sql
in this folder :
touch globals/models/bla/blub.le.sql
Now add a SELECT
statement in it.
SELECT
x,
y,
z
FROM
{{ ref "table1" }}
You define variables in the CONFIG block of the local model and use these variables in the global model.