Quick Filters

Build custom filters in Subject Management to search for subjects and encounters by date, status, or variable value.

Role required: Project Management

Create a quick filter

  1. Sign in at https://my.studytrax.com.
  2. Open the project.
  3. On the Home page, select New Quick Filter.
  4. Enter a name and expression.
  5. Save.

Home Subjects view with search, quick filter buttons, and subject list
Home Subjects view with search, quick filter buttons, and subject list

Expression syntax

Quick filter expressions use SQL-like syntax with variables prefixed by #. Combine multiple conditions with AND / OR.

Parameterized filters

Use PARAM to prompt for a value when the filter runs. Without PARAM, the filter uses a fixed value.

PatternBehavior
#EncounterDate = PARAM(#EncounterDate, "Date")Prompts for an exact date
#ReferenceID ~= PARAM(#ReferenceID, "Search by Reference ID")Partial match (contains)
#SiteCode = PARAM(#SiteCode, "Site")Dropdown shows site names

Use ~= for partial matching (contains). Omit ~= for exact match—useful for dropdowns like sex or diagnosis.

Set a default width with width= in the PARAM options.

Date functions

FunctionExampleResult
DATE(year, month, day)#EnrollmentDate > DATE(2024, 1, 1)After Jan 1 2024
TODAY#EnrollmentDate = TODAYToday's date
DATEDIFF(unit, start, end)DATEDIFF(day, #EnrollmentDate, TODAY) <= 30Enrolled in last 30 days
DATEPART(part, date)DATEPART(year, #ScreeningDate) = 2024Screened in 2024

Date arguments use numeric month (1–12), numeric day, and four-digit year.

Completion status filters

Filter for incomplete encounters or subjects.

VariableValues
#EncounterCompletionStatus0 = incomplete, 2 = complete
#ProjectSubjectCompletionStatus0 = incomplete, 2 = complete
#AggregateCompletionStatus0 = incomplete, 2 = complete

Example: #EncounterCompletionStatus = 0 returns encounters missing required data.

Search by variable

VariableExample
#ReferenceID#ReferenceID ~= PARAM(#ReferenceID, "Reference ID")
#ProjectID#ProjectID = PARAM(#ProjectID, "Project ID")
#SiteCodeDropdown shows site names
#LastName#LastName ~= PARAM(#LastName, "Last Name")
#dob#dob = PARAM(#dob, "Date of Birth")

For pick-list variables (sex, diagnosis), use PARAM without ~= to show a dropdown.

Due-window filters

Find encounters due within a window or not yet occurred.

ScenarioExpression
Due in next 7 daysDATEDIFF(day, TODAY, #CalculatedDueDate) <= 7 AND DATEDIFF(day, TODAY, #CalculatedDueDate) >= 0
Past due#CalculatedDueDate < TODAY AND #EncounterDate = "NULL"
Not yet occurred#EncounterDate = "NULL"
Created in past 30 days#EncounterDate != "NULL" AND DATEDIFF(day, #EncounterDate, TODAY) <= 30

Related variables: #CalculatedDueDate, #ScheduledDate, #DueDate.

Search behavior

The search box accepts space-separated tokens. Each token must appear somewhere in the field.

Example: typing ho er matches a name containing those two substrings (like "Homer" or "John Hoerner"). Wildcards are not needed.

Related

  • Subjects — navigate Subject Management
  • Run reports — due lists and data completion
  • Export — Data Sets filters use similar syntax