Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH feedbacks AS (
SELECT
DATE_TRUNC(TIMESTAMP_MILLIS(CAST(JSON_EXTRACT_SCALAR(DATA, "$.createdAt") AS INT)), DAY) AS day,
JSON_EXTRACT_SCALAR(DATA, "$.giverEmail") AS giverEmail,
JSON_EXTRACT_SCALAR(DATA, "$.receiverEmail") AS receiverEmail

FROM firestore_export.feedback_raw_latest
)
SELECT DISTINCT *
FROM feedbacks
WHERE JSON_EXTRACT_SCALAR(DATA, "$.status") = "done"
2 changes: 2 additions & 0 deletions usage-analytics/create-analytics/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,6 @@ def create_analytics_tables(*_):
execute_query("externe_feedbacks_per_month.sql", "feedzback_usage", "externe_feedbacks_per_month")
# This query answer the question "how many feedbacks are shared with managers each month"
execute_query("shared_feedbacks_per_month.sql", "feedzback_usage", "shared_feedbacks_per_month")
# This query answers the question: "What is the number of givers and the number of receivers"
execute_query("feedbackers_giver_receiver_repartition.sql", "feedzback_usage", "feedbackers_giver_receiver_repartition")
return 'OK'