Hello everyone, I am in exercise 30: counting number of customers per country in a month.
The solution to the exercise has this query:
SELECT
COUNT(*)
FROM users
WHERE
signup_date BETWEEN '2018-01-01' AND '2018-01-31'
AND status = 'customer'
AND country = 'in'
but I performed a different query:
SELECT
COUNT(CASE WHEN status ='customer' THEN id END) AS count_customer_in
FROM users
WHERE country = 'in'
AND
signup_date BETWEEN '2018-01-01' AND '2018-01-31';
that led me to the result.
My question is: Would it be good practice to query it in this last way? Regards.
I am slightly confused about the soft activation calculation.
In chpt 183, soft activation rate is calculated by Count cohort users who have a specific event divided by Count all cohort users.
But in chpt 184, it is calculated as Count cohort users who have a specific event divided by signup users.
As per my understanding specific users event should be divided with signup users.
Can you please clarify this?
Hello, I have a questions and it is…
I have created_date
and resolved_date
as columns in tickets
table. In other table I have sat_calendar with all days since 2020-06-01 and I identified Sunday, Saturdays and Holidays in description
column.
But now I need to calculate difference between created_date
and resolve_date
in working_days.
I did new table with row_number to working_day but I couldn’t do put ‘the previuos’ number if the created or resolved date is some holiday.
Could someone help me please?