Hello everyone! It’s actually my first post here, and I’m a total newbie in programming.
So, I’ve been doing the named project, and actually everything works, but at the very last task I get numbers, which are different from the answer.
"6. How many last touches on the purchase page is each campaign responsible for?
This query will look similar to your last-touch query, but with an additional
so, the answer in the video is 115 - 113 - 54 - 52 - 9 - 9 - 7 - 2
and mine is 114 - 112 - 53 - 9 - 9 - 7 - 2.
I wouldn’t be surprised if the answer was completely different or nothing worked, but this partial difference really confuses me.
On top of it, previous query from question 5 was to count total "last touches on the purchase page " and it returned 361, whuch is a sum of correct answer, not mine. So it means, that 3 “last touches” were lost somewhere between the queries. Does anyone have any idea, where and why were they lost? Thanks in advance! (code included below - a bit different from the given sample, but yet everything else worked and gave correct results)
WITH last_touch_x AS
MAX(timestamp) AS last_touch_time,
GROUP BY user_id
FROM last_touch_x AS ltx
JOIN page_visits AS pv
ON ltx.user_id = pv.user_id
AND ltx.last_touch_time = pv.timestamp
WHERE page_name = ‘4 - purchase’
GROUP BY 4
ORDER BY 1 DESC;