This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% macro trange_join(left_model, left_fields, left_primary_key, right_models) %} | |
{# | |
This macro allows the user to join two or more snapshot models together on a common | |
key, with the result being a unique record for each distinct time range. For example, | |
Given left_model: | |
| {{ join_key }} | left_field | dbt_valid_from | dbt_valid_to | | |
| - | - | - | - | | |
| k1 | L1 | 2020-01-01 | 2020-01-05 | | |
| k1 | L2 | 2020-01-05 | 2999-12-31 | |