Lesson 2 of 3 · Entity histories
Count facilities without losing their records
16 minute lesson · 3 checks along the way
Your goal for this lessonReconcile observation rows, overlap memberships and unique facilities while preserving multiple visits and namesakes.
In this lesson 4 sections · 3 checks
Read & understand
Choose the thing being counted
A field visit, a facility and a match between a facility record and a zone are different objects. One facility can be visited repeatedly, and a record can intersect more than one overlapping zone. ODK’s Entity documentation separates a system identifier from a displayed label and allows submissions to create or update entities. It also notes that labels need not be unique. These platform concepts help explain the problem; they do not establish PINAS’s particular database configuration.
Our independent fictional ledger contains five observation records, O1 through O5, linked to four facilities, F1 through F4. O1 records F1, O2 records F2, O3 records F3, and O4 records F4 on January 1. O5 records another visit to F3 on January 2. IDs are stipulated to be trustworthy. This is an invented schema, and its facility labels and dates are not local administrative data.
Read & understand
Follow the multiplication introduced by an overlap
Zone A contains facilities F1, F2 and F3. Zone B contains F3 and F4. In this example, memberships are unchanged between the two visits. A join that emits one row for every observation–zone match produces O1/A, O2/A, O3/A, O3/B, O4/B, O5/A and O5/B. Seven rows are correct for that join. They are not seven visits or seven different facilities.
Counting unique facility IDs inside each zone gives three in A and two in B. Adding those counts gives five because F3 belongs to both zones. Across the union of the zones there are four facilities. The five original observations and seven joined rows still have legitimate uses, but their row totals answer different questions. The existing Earth-observation course introduces set union; here the extra step is retaining both the visit history and each entity’s overlapping memberships.
Check 1 of 3
10 pointsUse the reading above. You can try again without losing points.
Read & understand
Keep namesakes and repeat visits distinct
Give both F2 and F4 the display label “Clinic”, while F1 is “Central school” and F3 is “North hall”. There are three distinct labels but four facilities. Deduplicating by label would merge the two clinics even though their IDs establish separate entities. Conversely, retaining all five observation rows as five facilities would count F3’s second visit as a new place. Neither shortcut is justified.
Removing O5 from storage is not the solution to overcounting facilities. It contains a separate visit that may matter for a time series, quality review or later correction. Keep observation records intact and construct the entity-level view needed for the question. A count should declare its observation window, identity key and treatment of overlap so another analyst can reproduce it.
Keep visits distinct from facilities
Trusted identities and unchanged memberships are stipulated. Labels alone do not establish identity; dated visits must remain available.
Open full-size diagram in a new tab: Keep visits distinct from facilitiesRead diagram data as a table
| Observation | Facility | Matched zones |
|---|---|---|
| O1 | F1 | A |
| O2 | F2 | A |
| O3 | F3 | A and B |
| O4 | F4 | B |
| O5 (later visit) | F3 | A and B |
Trusted identities and unchanged memberships are stipulated. Labels alone do not establish identity; dated visits must remain available.
Check 2 of 3
10 pointsUse the reading above. You can try again without losing points.
Read & understand
Leave unresolved identity visible
The example assumes that O3 and O5 are known to concern F3. In a real ledger, two similar names or nearby coordinates alone may not establish that link. If a record lacks a trusted facility identifier, retain it for reconciliation instead of silently joining it to the nearest name. A system can track an unresolved observation without pretending to know whether it represents an existing facility or a new one.
Before reporting exposure, also verify that multiple visits describe a compatible time and that zone membership has not changed. Our seven-row example deliberately holds membership fixed; a changed location or boundary would require a time-aware join. The useful result is an auditable relationship among observations, entities and zones, not merely a smaller row count.
Check 3 of 3
10 pointsUse the reading above. You can try again without losing points.
Put it together
Your lesson progress
Each check connects to a part of the story. Complete all 3 to earn your 25-point lesson bonus.
Explore further · Optional
Go to the source
Explore the evidence behind this lesson. These optional readings and videos open in a new tab.