From 4655cf37f71db7bf870f786b4cd3d3090c9fac29 Mon Sep 17 00:00:00 2001 From: Cristhian Garcia Date: Thu, 30 May 2024 11:40:41 -0500 Subject: [PATCH] fix: use the final keyword --- models/enrollment/fact_current_enrollments.sql | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/models/enrollment/fact_current_enrollments.sql b/models/enrollment/fact_current_enrollments.sql index 6f1504c8..15f188c3 100644 --- a/models/enrollment/fact_current_enrollments.sql +++ b/models/enrollment/fact_current_enrollments.sql @@ -1,20 +1,8 @@ with - all_enrollment as ( - select - course_key, - actor_id, - enrollment_mode, - enrollment_status, - emission_time, - row_number() over ( - partition by course_key, actor_id order by emission_time desc - ) as rn - from {{ ref("fact_enrollment_status") }} - ), enrollments as ( - select course_key, actor_id, enrollment_status, enrollment_mode, emission_time - from all_enrollment - where rn = 1 + select course_key, actor_id, enrollment_mode, enrollment_status, emission_time, + from {{ ref("fact_enrollment_status") }} + where enrollment_status = 'registered' FINAL ) select