Skip to content

Commit

Permalink
Merge pull request #61 from fivetran/backlog_bug
Browse files Browse the repository at this point in the history
Backlog tickets fix
  • Loading branch information
fivetran-joemarkiewicz authored Jan 10, 2022
2 parents dca90e1 + 0a29878 commit edfb4eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions models/ticket_history/int_zendesk__field_history_scd.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ with change_data as (
,sum(case when {{ col.name }} is null
then 0
else 1
end) over (order by ticket_id, date_day rows unbounded preceding) as {{ col.name }}_field_patition
end) over (order by ticket_id, date_day rows unbounded preceding) as {{ col.name }}_field_partition
{% endfor %}

from change_data
Expand All @@ -36,7 +36,7 @@ with change_data as (

{% for col in ticket_columns if col.name|lower not in ['date_day','ending_day','ticket_id','ticket_day_id'] %}

,first_value( {{ col.name }} ) over (partition by {{ col.name }}_field_patition order by valid_from asc rows between unbounded preceding and current row) as {{ col.name }}
,first_value( {{ col.name }} ) over (partition by {{ col.name }}_field_partition, ticket_id order by valid_from asc rows between unbounded preceding and current row) as {{ col.name }}

{% endfor %}
from set_values
Expand Down

0 comments on commit edfb4eb

Please sign in to comment.