## Bug description

*Please describe.*  
- some datapoints show 0 but people will appear in modal

*If this affects the front-end, screenshots would be of great help.*  

## Expected behavior
- amount of people and datapoint should be the same


## How to reproduce

1. demo data clickhouse instance
2. go to retention trends for a day with some people


## Environment

- [ ] PostHog Cloud
- [ ] self-hosted PostHog, version/commit: _please provide_

## Additional context



#### *Thank you* for your bug report – we love squashing them!

ee/clickhouse/sql/retention/people_in_period.py
e.uuid as uuid,
        e.event as event
        FROM events e join (SELECT person_id, distinct_id FROM person_distinct_id WHERE team_id = %(team_id)s) pdi on e.distinct_id = pdi.distinct_id
        where toDateTime(e.timestamp) >= toDateTime(%(start_date)s) AND toDateTime(e.timestamp) <= toDateTime(%(end_date)s)
        AND e.team_id = %(team_id)s {returning_query} {filters}
    ) event
    JOIN (
        {first_event_sql}
    ) reference_event
        ON (event.person_id = reference_event.person_id)
    WHERE {trunc_func}(event.event_date) > {trunc_func}(reference_event.event_date)
    UNION ALL
    {first_event_default_sql}
) person_appearances
WHERE base_interval = 0
GROUP BY person_id
ORDER BY appearance_count DESC
LIMIT %(limit)s OFFSET %(offset)s
"""
REFERENCE_EVENT_PEOPLE_PER_PERIOD_SQL = """
SELECT DISTINCT 
{trunc_func}(e.timestamp) as event_date,
pdi.person_id as person_id,
e.uuid as uuid,
e.event as event
from events e JOIN (SELECT person_id, distinct_id FROM person_distinct_id WHERE team_id = %(team_id)s) pdi on e.distinct_id = pdi.distinct_id
where event_date = {trunc_func}(toDateTime(%(start_date)s))
AND e.team_id = %(team_id)s {target_query} {filters}
"""
DEFAULT_REFERENCE_EVENT_PEOPLE_PER_PERIOD_SQL = """