hardcompany HR · Q5
date spinenon-equi joinpoint in time

Headcount at every month end

For each month of 2024, count how many people were employed on the last day of that month.

Someone counts on a given day if they were hired on or before that day, and either haven't left or left after that day. Leaving on the last day of the month means they're not counted at that month end.

Return 12 rows, month_end as a date (2024-01-31, 2024-02-29, ...), even for months where the headcount is 0.

output columns
month_endheadcount

uses

ctrl + enter to run on the sample data · ctrl + shift + enter to submit

run your query to see the output here. Submit checks it against the sample data, hidden test cases, random data and a large dataset.