KMs covered over weeks
#2
by
reach-vb
HF staff
- opened
SELECT
DATE_TRUNC('week', start_date::DATE) AS week_start,
SUM(distance) AS total_distance,
bar(total_distance, 0, MAX(SUM(distance)) OVER (), 60) AS chart
FROM
train
WHERE
type = 'Run' AND
start_date::DATE >= '2024-08-01'
GROUP BY
week_start
ORDER BY
week_start;