Compare commits
4 Commits
506dda094d
...
3486b4f509
| Author | SHA1 | Date | |
|---|---|---|---|
| 3486b4f509 | |||
| 2da0aff227 | |||
| 14fb081542 | |||
| aef1d13279 |
@@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
with distinct_cycles as (
|
with distinct_cycles as (
|
||||||
select
|
select
|
||||||
|
min(step_submission_date) as cycle_start_date,
|
||||||
|
max(step_submission_date) as cycle_end_date,
|
||||||
task_name,
|
task_name,
|
||||||
case
|
case
|
||||||
when count(case when task_status != 'Completed' then 1 end) = 0
|
when count(case when task_status != 'Completed' then 1 end) = 0
|
||||||
@@ -19,9 +21,9 @@ with distinct_cycles as (
|
|||||||
|
|
||||||
select
|
select
|
||||||
dense_rank() over (order by task_name)::bigint as id,
|
dense_rank() over (order by task_name)::bigint as id,
|
||||||
null::date as start_date,
|
cycle_start_date::date as start_date,
|
||||||
null::date as end_date,
|
cycle_end_date::date as end_date,
|
||||||
task_name as name,
|
task_name as name,
|
||||||
task_status as status,
|
'Closed' as status, -- overwritten logic for Sarens
|
||||||
task_name as type
|
'annual' as type
|
||||||
from distinct_cycles
|
from distinct_cycles
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ select
|
|||||||
row_number() over (order by user_id, task_name)::bigint as id,
|
row_number() over (order by user_id, task_name)::bigint as id,
|
||||||
null::date as start,
|
null::date as start,
|
||||||
status,
|
status,
|
||||||
nullif(regexp_replace(overall_rating, '\D','','g'), '')::numeric as overall_rating_value,
|
nullif(regexp_replace(overall_rating, '^(\d+).*', '\1'), '')::numeric as overall_rating_value,
|
||||||
overall_rating as overall_rating_text,
|
overall_rating as overall_rating_text,
|
||||||
cycle_id,
|
cycle_id,
|
||||||
worker_id,
|
worker_id,
|
||||||
|
|||||||
@@ -17,6 +17,16 @@ steps as (
|
|||||||
user_id::text as user_id,
|
user_id::text as user_id,
|
||||||
task_name,
|
task_name,
|
||||||
step_title as name,
|
step_title as name,
|
||||||
|
case
|
||||||
|
when step_title in ('Auto-évaluation des employés', 'Employee Self Review', 'Sarens Projects Review',
|
||||||
|
'Approbation des employés', 'Strategy Review', 'Finance Review',
|
||||||
|
'Sales Review', 'Fleet Review', 'Self Review', 'LCM Review', 'Operations Review') then 1
|
||||||
|
when step_title in ('Évaluation du manager', 'Functional Manager Review', 'Discussion et approbation du manager',
|
||||||
|
'Manager Review') then 2
|
||||||
|
when step_title in ('HR Review', 'SHEQ Review', 'Performance Conversation & Manager Sign-off') then 3
|
||||||
|
when step_title = 'Employee Sign-Off' then 4
|
||||||
|
else null -- fallback for any unexpected values
|
||||||
|
end as sequence_number,
|
||||||
step_status as status,
|
step_status as status,
|
||||||
step_submission_date::date as completed_at
|
step_submission_date::date as completed_at
|
||||||
from {{ source('tap_spreadsheets_anywhere', 'performance_review_steps') }}
|
from {{ source('tap_spreadsheets_anywhere', 'performance_review_steps') }}
|
||||||
@@ -27,6 +37,7 @@ select
|
|||||||
row_number() over (order by s.user_id, s.task_name, s.name)::bigint as id,
|
row_number() over (order by s.user_id, s.task_name, s.name)::bigint as id,
|
||||||
r.review_id,
|
r.review_id,
|
||||||
s.name,
|
s.name,
|
||||||
|
s.sequence_number,
|
||||||
s.status,
|
s.status,
|
||||||
s.completed_at,
|
s.completed_at,
|
||||||
null::date as due
|
null::date as due
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ total_scores as (
|
|||||||
select
|
select
|
||||||
r.review_id,
|
r.review_id,
|
||||||
t.section_name as dimension,
|
t.section_name as dimension,
|
||||||
nullif(regexp_replace(t.final_rating, '\D','','g'), '')::numeric as score_value,
|
nullif(regexp_replace(t.final_rating, '^(\d+).*', '\1'), '')::numeric as score_value,
|
||||||
nullif(trim(t.final_rating), '') as score_text,
|
nullif(trim(t.final_rating), '') as score_text,
|
||||||
null::text as comment
|
null::text as comment
|
||||||
from {{ source('tap_spreadsheets_anywhere', 'performance_review_total_scoring') }} t
|
from {{ source('tap_spreadsheets_anywhere', 'performance_review_total_scoring') }} t
|
||||||
|
|||||||
Reference in New Issue
Block a user