> For the complete documentation index, see [llms.txt](https://docs.lucernahealth.com/guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lucernahealth.com/guide/insights-studio/population-builder/reference-guides/how-to-build-populations.md).

# How to build populations

A population is a defined group of members built from conditions across the data. Building one means translating a business question into rules the system can run.

A request like *"diabetic members who are overdue on their care"* needs to be broken into parts before any rule is written: what defines diabetic, what counts as overdue, and who should be left out. This guide covers that process: how to structure a query, when to reuse existing content, and how the AND/OR logic determines your results.

***

### Three Ways to Add a Rule

Every rule in a population comes from one of three places.

#### Add Field

Build a rule directly from the data model — select a field, choose an operator, enter a value.

* **Use when:** The condition is simple and specific to this population
* **Example:** Deceased = true, Age between 50 and 74

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FQ6KGgMrQz4FMgdZEhW6B%2FScreenshot%202026-08-24%20at%208.26.33%E2%80%AFPM%201.png?alt=media&amp;token=9b20d62c-4a96-403e-b0fa-76fa957e1744" alt=""><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FeSvBA01DZ2oKkiBxu5iY%2FScreenshot%202026-08-25%20at%208.15.28%E2%80%AFAM%201.png?alt=media&amp;token=b207150c-9ba3-4b6b-833b-5ed607ac3988" alt=""><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2F6Ds3QDOZ68vmkhj3QxSJ%2FScreenshot%202026-08-25%20at%208.14.21%E2%80%AFAM%201.png?alt=media&amp;token=3235ba65-4768-4530-9c97-ce6cdb30d85d" alt=""><figcaption></figcaption></figure></div>

#### Add Block

Reference an existing block, pulling in reusable logic.

* **Use when:** The logic is common and already defined
* **Example:** Active Roster Member

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2Flqpckjg8Fgc8fOinMDUF%2FScreenshot%202026-08-25%20at%208.16.36%E2%80%AFAM%201.png?alt=media&amp;token=d0816d55-0f53-4d7b-948a-7004d53470c7" alt=""><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2F3hIIDhu6VvuMY6cd5u2r%2FScreenshot%202026-08-25%20at%208.17.12%E2%80%AFAM%201.png?alt=media&amp;token=c4fbaa50-6c8c-4cc6-b6d7-51a031bf5371" alt=""><figcaption></figcaption></figure></div>

#### Add Population

Reference another population as a building block.

* **Use when:** The logic is complex enough to have been built as a standalone population
* **Example:** Diabetic Eye Exam – Open

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FGAzuH5JElmlLZTB3uPwK%2FScreenshot%202026-08-25%20at%208.17.58%E2%80%AFAM%201.png?alt=media&amp;token=f5809f94-470b-4b3f-a62f-48c88aec70a5" alt=""><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2Fvh4XiSQZ6G7mQjZBs33y%2FScreenshot%202026-08-25%20at%208.18.33%E2%80%AFAM%201.png?alt=media&amp;token=cfdb6e32-56ee-48c8-8497-f5104bebbf32" alt=""><figcaption></figcaption></figure></div>

Before building anything from scratch, search what already exists. Complex logic that spans several conditions is more likely to exist as a population than a block.

***

### Creating a Population

1\. Click Add Population button to start creating a new population. If you're exploring and don't need to keep the result, you can skip the details and go straight to the Definition tab.

| Field        | Notes                                                                                                                                                       |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name         | Clear title, visible wherever the population appears                                                                                                        |
| Key          | Generates automatically and can be edited at creation, but not changed once saved. Two populations can share a name, but each population key must be unique |
| Category     | Business area used for grouping and filtering                                                                                                               |
| Description  | Short summary of what the population contains and any caveats                                                                                               |
| Run Schedule | Set up after the population is saved. Adding a run schedule requires fine grain permissions                                                                 |

2\. Go to the Definition tab. This is where the query is built. It has two panels:

* Left: the query builder, where rules are added
* Righ&#x74;**:** the count and funnel breakdown, which updates as you build

The root table sits above the query builder panel. It's the table the population is counted against. Leave it alone unless you have a specific reason to change it

Once you save the population, you can access other tabs like Preview Data, References, Destinations and Run History<br>

***

### Creating a Simple Population

#### Goal: Build a population for all members with diabetes who are overdue for an A1c  test and haven't been seen recently

#### Step 1. Break the question down

Split the request into parts. Working out the parts first tells you what to search for

1. All members
2. Members with an open A1C care gap
3. Members with an appointment in the last six months

#### Step 2. All members

Start with "all members." Blocks are reusable logic, so there's a good chance one already exists for something this common.&#x20;

* Click Add Block to check.

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2Flqpckjg8Fgc8fOinMDUF%2FScreenshot%202026-08-25%20at%208.16.36%E2%80%AFAM%201.png?alt=media&amp;token=d0816d55-0f53-4d7b-948a-7004d53470c7" alt=""><figcaption></figcaption></figure></div>

* Type 'members' in the search box to see relevant blocks. "All members" could map to the **Active Roster Member** block. Active roster is how we define who currently counts as a member.

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2Fno5QDmLoiPTrQaWo52xT%2FScreenshot%202026-08-25%20at%208.26.11%E2%80%AFAM%201.png?alt=media&amp;token=191f2e39-5256-40f2-9f51-9ef423c55b20" alt=""><figcaption></figcaption></figure></div>

* To view the added block, click it and it opens in a new tab.

#### Step 3. The A1C care gap

The second part: diabetics overdue for an A1C, is too specific and complex to work as a reusable block. It fits better as its own population, so click Add Population to check.

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FGGUPpnGDj7PnFXF5S0Zd%2FScreenshot%202026-08-25%20at%208.38.25%E2%80%AFAM%201.png?alt=media&amp;token=b69e2933-8150-49fb-98b0-84b04f63660a" alt=""><figcaption></figcaption></figure></div>

* Type 'A1c' in the search box to see relevant populations. Care gap measures usually appear as three separate populations. A1C Control – Open is the one we need.

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FVwP2XhtuCRjLKjfflIF8%2FScreenshot%202026-08-25%20at%208.33.25%E2%80%AFAM%201.png?alt=media&amp;token=2ff0d138-dbd4-4105-8569-5b734557cd29" alt=""><figcaption></figcaption></figure></div>

| Version   | What it contains                        |
| --------- | --------------------------------------- |
| Eligible  | Everyone who should receive the service |
| Completed | Everyone who already has                |
| Open      | Eligible, but not yet done — the gap    |

#### Step 4. Recent appointments (in last 6 months)

The last part is specific to this query, so building it from scratch makes the most sense.&#x20;

* Click Add Field, then Select Column.

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FAPnWTFFTKRuYyJrR5RI0%2FScreenshot%202026-08-25%20at%208.39.11%E2%80%AFAM%201.png?alt=media&amp;token=7a5d1ef9-f7e3-4719-87a3-30c615fcefac" alt=""><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FEeJpC2i7ZYimoWGjOm30%2FScreenshot%202026-08-25%20at%208.39.30%E2%80%AFAM%201.png?alt=media&amp;token=58e274a2-fd7a-401e-acd6-320d54c7b897" alt=""><figcaption></figcaption></figure></div>

* Type 'appointment' in the search bar for selecting a column. If you know the table you are looking for, you can start with selecting 'Search by table' option

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FAgRLQZVKGseRoANnjleA%2FScreenshot%202026-08-25%20at%208.41.42%E2%80%AFAM%201.png?alt=media&amp;token=5298c68d-4a23-4a45-92a6-f25b4625f5a7" alt=""><figcaption></figcaption></figure></div>

* 'Appointment' search term has many results, lets narrow it down. Checking when a member was last seen means looking at their appointment dates. Let's try 'appointment date'

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FeAlAwBrZNgmCemQjJYxb%2FScreenshot%202026-08-25%20at%208.45.31%E2%80%AFAM%201.png?alt=media&amp;token=3b6e91ed-4030-4da7-82ae-ec77d234417c" alt=""><figcaption></figcaption></figure></div>

* Here we have the same column from two different tables. Always select the one on the top. You can hover over the info icon next to table name to learn more about the table.&#x20;

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FrUrTycN4vm7UEcYZGvZx%2FScreenshot%202026-08-25%20at%208.48.13%E2%80%AFAM%201.png?alt=media&amp;token=f2c6e776-f256-4153-ae55-869537227a91" alt=""><figcaption></figcaption></figure></div>

* Then set the operator. "Last six months" should always mean six months from whenever the population runs, a fixed date would need updating every time. So a relative operator works best here.

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2F0dEup9PDyjI9JTiMH1io%2FScreenshot%202026-08-25%20at%208.50.53%E2%80%AFAM%201.png?alt=media&amp;token=0b2f124e-89a1-442e-a52f-c95870dfddd0" alt=""><figcaption></figcaption></figure></div>

* Select order: Last N Calendar

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FJKh07geaTCpaxC2xqXSd%2FScreenshot%202026-08-25%20at%208.51.48%E2%80%AFAM%201.png?alt=media&amp;token=1f9ed865-f567-48a8-a3cd-677cc66ea2d7" alt=""><figcaption></figcaption></figure></div>

* Select interval: months and type 6

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FbdSh5RjJiSgrnmmThKts%2FScreenshot%202026-08-25%20at%208.53.19%E2%80%AFAM%201.png?alt=media&amp;token=896e3ed2-bd71-405e-8fb3-909a7674e9e3" alt=""><figcaption></figcaption></figure></div>

#### Step 5. Read the result

The finished query has three rules, each labelled with where it came from:

<table><thead><tr><th width="70.08984375">#</th><th>Rule</th><th>Label</th></tr></thead><tbody><tr><td>1</td><td>Active Roster Member</td><td>Block</td></tr><tr><td>2</td><td>A1C Control – Open</td><td>Population</td></tr><tr><td>3</td><td>Last 6 months of appointments</td><td>Fct Appointment Provider Detail</td></tr></tbody></table>

The system auto-generates names for rules built from scratch. Rule 3 here becomes "Last 6 months of appointments." These names match across both panels, so you can trace any rule in the query to its effect on the funnel.

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FHitGA3dfAxV2oxGw8q1A%2FScreenshot%202026-08-25%20at%208.56.24%E2%80%AFAM%201.png?alt=media&amp;token=56b6f5bc-5e3d-4675-a6d5-b8d79a98c23e" alt=""><figcaption></figcaption></figure></div>

***

### Add Group

The example we jsut saw uses a single group, where all conditions must be true. When you need either/or logic, you need more than one group.

<table><thead><tr><th width="119.32421875">Logic</th><th>Applies</th><th>Meaning</th></tr></thead><tbody><tr><td>AND</td><td>Within a group</td><td>A member passes only if they meet every condition in that group</td></tr><tr><td>OR</td><td>Between groups</td><td>A member passes if they match any one group</td></tr></tbody></table>

The word **either** in a request is the signal that you need a second group.

If you want members who have either an open eye exam gap or an open kidney evaluation gap, those go in separate groups. Putting both in the same group would require members to have both.

**Note:** Because groups are joined by OR, each group must independently define a complete population. If a condition applies to both groups, it needs to appear in both.

#### Working With Groups

Group names generate automatically based on their contents. To rename one, use the menu icon and select Update Group Name. Once renamed manually, automatic naming stops for that group, even if you add or remove conditions later.

**Reordering:** Drag conditions to reorder them within a group.

**Duplicating:** Use the copy icon to duplicate a condition. Only rules can be duplicated — not blocks or populations.

**Removing:** Removing a group updates the count immediately.

***

### Exclude

Everything in the Include section defines who's in the population. Exclude takes members back out.

Anyone matching an Exclude condition is removed from the list, regardless of which group qualified them.

**Note:** For a single condition such as Deceased = true, building from scratch is quicker than searching for something to reuse.

***

### Managing Populations

#### Saving

Saving a population unlocks the remaining tabs: Preview Data, References, Destinations, and Run History. To save, make sure all required fields on the Details tab are filled in.

If you're just exploring and don't want to keep the population, click Cancel to return to the Populations tab.

#### Editing the definition

Once a population is saved, you can edit its Definition using the pencil icon on the right.

Changes go live in two steps. Save your changes and review them, then Publish to push that version live. Until you publish, the live population is unchanged.

Every edit is saved as its own version, and any previous version can be previewed and restored.

#### Scheduling

Run schedules are configured after the population is saved. Scheduling requires team-level permission, granted under Fine Grain Permissions in Teams.

***

### Best Practices

#### Structure

* Break the business question into parts before building anything
* Search for existing blocks and populations before building from scratch
* Keep each group independently complete, groups are joined by OR
* Use relative operators for anything time-based

#### Naming

* Name the population for what it contains, not how it was built
* Complete the description, it's what tells the next person whether this is the population they need
