--This query will display the occupancy of trips & average duration trip per user type & by which day the trip occurred.
with a AS (
SELECT
user_type,
name_of_day,
COUNT(*) AS user_count,
ROUND((COUNT(*)/SUM(COUNT(*))OVER(PARTITION BY user_type))*100,2) AS percentage,
ROUND(AVG(trip_duration_h),3) AS avg_trip_duration
FROM `fresh-ocean-357202.Cyclistic.Cyclistic_clean`
GROUP BY
user_type,
name_of_day
ORDER BY user_type ASC
)
SELECT *,
EXTRACT(DAY FROM PARSE_DATE('%A', name_of_day)) AS day_number
FROM a
ORDER BY user_type,day_number
I've tried to use the PARSE_DATE function but it returns the value 1 for all. 'name_of_day' field name is STRING where the values are: Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday

I find it weird because I was able to arrange my data by month (Jan-Dec) by
EXTRACT(MONTH FROM PARSE_DATE('%B', month)) AS month_number
where 'month' is also a string with values: January,February and so on... or did it just worked coincidentally?