Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seyhunak/665d5817bdeb68fda0867f6b34af211a to your computer and use it in GitHub Desktop.
Save seyhunak/665d5817bdeb68fda0867f6b34af211a to your computer and use it in GitHub Desktop.
[BigQuery + Firebase Predictions] Number of Users Predicted to Churn - French Users
SELECT COUNT(distinct p.user_id)
FROM `friendly--pix.projectId.firebase_predictions.YOUR_PACKAGE_NAME_ANDROID` p CROSS JOIN UNNEST (predictions)
INNER JOIN `projectId.analytics_YOUR_TABLE.events_*`` a on p.user_id = a.user_id
WHERE
prediction_name = "churn"
AND score > 0.7
AND TIMESTAMP_TRUNC(p.prediction_time, DAY) = TIMESTAMP('2018-10-04')
AND a.geo.country = "France"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment