FORUM Marketing Analytics

Marketing Analytics

Let’s discuss how data works to analyze, improve and scale our marketing efforts. Ask your questions in funnel analysis, calculating CTR-s and ROIs, CPSs and CPCs 💰

Getting an error

From Exercise 66:

Let’s practice our newly learned skill of grouping and counting. Which email domain has the most amount of users at Bindle?

I am writing a code other way, by forming function. I am getting error. Could anyone help me to identify where I have mistaken?

WITH domain AS (
  SELECT
    SPLIT_PART (email, '@', 2) AS email_domain,
    FROM users
)

SELECT
  email_domain,
  COUNT(*)
FROM domain
GROUP BY 1
ORDER BY 2 DESC