sqlmesh icon indicating copy to clipboard operation
sqlmesh copied to clipboard

Add model's latest variable

Open eakmanrq opened this issue 1 year ago • 0 comments

Add a variable that can be used to access a specific model's latest interval.

Ex: I have db.user model. To access latest date string I would do:

WHERE
    ds = @DB__USER__LATEST_DS

The key concept is that latest is local to each model and therefore if you want to access a table that has history of values on it and you always want "latest" then you can use this variable.

eakmanrq avatar Aug 16 '23 21:08 eakmanrq