Created
June 1, 2017 16:38
-
-
Save jdwyah/246d581fca29db0962216a4570ecb53e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
results AS ( | |
SELECT | |
event, | |
experiment_test, | |
experiment_result, | |
day, | |
count(DISTINCT first_exposures.tracking_id) exposures, | |
count(DISTINCT conversions_order_placed_1.tracking_id) order_placed_1, | |
count(DISTINCT conversions_order_placed_1.tracking_id) / | |
count(DISTINCT first_exposures.tracking_id) :: FLOAT conversion_rate | |
FROM first_exposures | |
LEFT JOIN conversions_order_placed_1 | |
ON first_exposures.tracking_id = conversions_order_placed_1.tracking_id AND | |
conversions_order_placed_1.created_at > first_exposures.created_at | |
GROUP BY 1, 2, 3, 4 | |
ORDER BY 1, 2, 3, 4 | |
), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment