I’m in the process to finish the WP assignement but i didn’t get where the error is in the following code.
I’m basically try to calculate the difference in purchase rates between customers who had 3 number of pairs with ones who had 5.
I moved on with the following code but I haven’t get any result so far from the query.
Is there anyone who can help me on the code?
WITH data AS (
SELECT DISTINCT q.user_id,
h.user_id IS NOT NULL AS ‘is_home_try_on’,
h.number_of_pairs AS ‘A/B variant’,
p.user_id IS NOT NULL AS ‘is_purchase’
FROM quiz q
LEFT JOIN home_try_on h
ON q.user_id = h.user_id
LEFT JOIN purchase p
ON p.user_id = q.user_id
SELECT A/B variant,
WHEN is_home_try_on = 1
WHEN is_purchase = 1
GROUP BY 1;