Skip to content

Instantly share code, notes, and snippets.

@preetamtt
Created April 12, 2018 19:27
Show Gist options
  • Save preetamtt/abf7436fedfb7c5b65a12d9182c367b4 to your computer and use it in GitHub Desktop.
Save preetamtt/abf7436fedfb7c5b65a12d9182c367b4 to your computer and use it in GitHub Desktop.
SELECT
COUNTIF(customer_interaction_count_3d >= 2 AND hired_time IS NOT NULL)/COUNTIF(customer_interaction_count_3d >= 2) AS hire_given_twoplus_interactions
, COUNTIF(customer_interaction_count_after_pro_response_to_first_contact_3d >= 1 AND hired_time IS NOT NULL)/COUNTIF(customer_interaction_count_after_pro_response_to_first_contact_3d >= 1) AS hire_given_oneplus_conversation
FROM a.contacts
WHERE TIMESTAMP_TRUNC(first_customer_contact_time, MONTH) = '2018-01-01 00:00:00'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment