diff --git a/transform/models/tap_spreadsheets_anywhere/performance_cycle.sql b/transform/models/tap_spreadsheets_anywhere/performance_cycle.sql index 2cb8706..47f54ec 100644 --- a/transform/models/tap_spreadsheets_anywhere/performance_cycle.sql +++ b/transform/models/tap_spreadsheets_anywhere/performance_cycle.sql @@ -6,6 +6,8 @@ with distinct_cycles as ( select + min(step_submission_date) as cycle_start_date, + max(step_submission_date) as cycle_end_date, task_name, case when count(case when task_status != 'Completed' then 1 end) = 0 @@ -19,9 +21,9 @@ with distinct_cycles as ( select dense_rank() over (order by task_name)::bigint as id, - null::date as start_date, - null::date as end_date, - task_name as name, - task_status as status, - task_name as type + cycle_start_date::date as start_date, + cycle_end_date::date as end_date, + task_name as name, + 'Closed' as status, -- overwritten logic for Sarens + task_name as type from distinct_cycles