Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs_src/dummy_data_in_opensafely.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,12 @@ csv files corresponding to the two tables that this dataset definition uses.
```py
from ehrql import create_dataset, debug
...
# show the date column from the original clinical_events table
debug(clinical_events.date)
events = clinical_events.sort_by(clinical_events.date).first_for_patient()
debug(events.date)
# filter to a patient frame, with the first event for each patient
first_events = clinical_events.sort_by(clinical_events.date).first_for_patient()
# show the date column from the filtered first_events frame
debug(first_events.date)
...
```

Expand Down