Skip to content

Commit

Permalink
new column name configuration for user enrolment warehouse
Browse files Browse the repository at this point in the history
  • Loading branch information
varshamahuli97 committed Aug 7, 2024
1 parent bd23923 commit 127d7e4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ object CommsReportModel extends AbsDashboardModel {
val rawEnrollmentsDF = spark.read.option("header", "true")
.csv(s"${conf.localReportDir}/${conf.userEnrolmentReportPath}/${today}-warehouse")
//.withColumn("completionDate", to_date(col("completed_on"), dateFormat2))
.withColumn("completionDate", date_format(col("last_accessed_on"), "dd/MM/yyyy HH:mm:ss a"))
.withColumn("completionDate", date_format(col("content_last_accessed_on"), "dd/MM/yyyy HH:mm:ss a"))
val enrollmentsDF = rawEnrollmentsDF
.join(userDF, Seq("user_id"), "left")

Expand Down Expand Up @@ -112,7 +112,7 @@ object CommsReportModel extends AbsDashboardModel {
generateReport(usersCreatedInLastNDaysWithoutEnrollmentsWithUserDetailsDF, s"${commsConsoleReportPath}/UsersOnboardedLast15DaysNotSignedUpAnyContent", fileName="UsersOnboardedLast15DaysNotSignedUpAnyContent")

//top 60 users ranked by cbp completion in last 15 days
val topXCompletionsInNDays = enrollmentsDF.filter(col("last_accessed_on").between(dateNDaysAgo, currentDate))
val topXCompletionsInNDays = enrollmentsDF.filter(col("content_last_accessed_on").between(dateNDaysAgo, currentDate))
.groupBy("user_id")
.agg(
count("*").alias("completionCount")
Expand Down

0 comments on commit 127d7e4

Please sign in to comment.