> For the complete user guide index, see [llms.txt](https://portraitresearch.com/documentation/llms.txt).

# Filter expressions, units, and missing data

[Canonical page](https://portraitresearch.com/documentation/screening/filter-reference/)

## Applicability

- **Task:** Verify the meaning and evaluation boundaries of a screen
- **Access:** Portrait account; extended Visible Alpha metrics require applicable firm entitlement
- **Audience:** Analysts and agents verifying Screening criteria
- **Surfaces:** web; ios
- **Availability:** Production with metric and account-dependent coverage
- **Content type:** reference
- **Last reviewed:** 2026-09-22

Use this reference to check what a screen evaluates on web and iOS. Build filters with the [AI Assistant](https://portraitresearch.com/documentation/screening/build-with-ai-assistant/) on either surface, or use the web app's manual editor. The web editor's metric list shows the variables available to your account.

## Filter types

| Type | Meaning | Boundary |
|---|---|---|
| Geography | Country of the company's primary exchange | Does not establish headquarters, revenue exposure, or country of operations; an unresolved exchange country fails the filter |
| Industry | Tags from the latest completed Company Primer | These are generated tags. A missing usable tag set fails even an exclusion filter |
| Quantitative | An expression evaluated against supported data | Missing inputs, inaccessible metrics, or evaluation errors do not establish that the business failed the intended economic condition |
| Qualitative | A written condition evaluated using supported company evidence | At most three per screen; source coverage, date windows, and licences apply |

An industry inclusion accepts a company matching any selected tag; an exclusion rejects a company matching any excluded tag. Separate filters combine as **AND**. Within a quantitative expression, `or` can express alternatives explicitly.

Execution applies geography and industry before quantitative filters, then qualitative filters. Cheaper market-data-only quantitative checks can run before other quantitative checks. Companies eliminated earlier have no later filter result; inspect the funnel rather than assuming every filter evaluated every company.

## Quantitative variables and periods

| Family | Examples | Interpretation |
|---|---|---|
| Market data | `market_cap`, `tev`, `latest_price`, `shares_outstanding`, `volume`, `average_daily_volume_30d` | Current supported market values; no fiscal-period suffix |
| Standard fundamentals | `revenue`, `gross_profit`, `ebit`, `ebitda`, `eps`, `capex`, `fcf` | Add a supported period, for example `revenue_LTM` or `eps_F1` |
| Period suffixes | `LTM`, `NTM`, `F0`, `F1`, `F2`, `F_N1` | Last/next twelve months, current/next/two-years-forward fiscal year, or prior fiscal year; fiscal periods follow each company's reporting calendar |
| Dated market values | `price_on_YYYY_MM_DD`, `volume_on_YYYY_MM_DD`, `market_cap_on_YYYY_MM_DD`, `tev_on_YYYY_MM_DD`, `shares_outstanding_on_YYYY_MM_DD` | Historical value associated with the requested date, subject to available observations |
| Price return | `return_since_YYYY_MM_DD` | Percentage price change from the dated price to the latest price; not a total-return or dividend-reinvestment measure |
| Extended fundamentals, ratios, or revisions | Select the exact variable and period offered to your account | Entitlement, unit, and period coverage vary; a familiar metric name is not evidence that the field is available |

Data coverage for each period varies by company and metric. Relative fiscal periods can advance as the provider's data advances. For the separate rules that move dated return variables on a rerun, see [Standard quantitative filters](https://portraitresearch.com/documentation/screening/standard-quantitative-filters/).

### Dated observations and price ranges

A standalone dated price, volume, market-capitalisation, enterprise-value, or shares-outstanding variable uses the closest available trading observation on or before that date within a seven-day lookback. A dated price can therefore refer to a preceding trading day, for example when the requested date is a market holiday. Inspect the resulting value and missing-data reason before assuming an observation exists on the exact calendar date.

For an interval aggregate, use `prices_between` as the sole argument of `min`, `max`, or `mean`, with exactly two date markers. For example:

```text
min(prices_between(price_on_2025_01_01, price_on_2025_12_31)) > 25
```

This checks whether the minimum available stock-price observation in that inclusive calendar interval exceeds $25. Inside `prices_between`, the two `price_on_…` names mark calendar boundaries rather than separately resolved dated observations. The helper does not invent observations on non-trading days.

The start must be on or before the end. Each interval may contain at most **3,660 calendar days**, counting both endpoints; an expression can request at most **eight distinct intervals**. The same interval used with different reducers counts once. Unsupported reducers, malformed dates, and empty or unavailable price data require correction or a missing-data review.

## Units and verified examples

Market capitalisation and enterprise value are evaluated in raw US dollars, including their dated variants. Standard revenue, profit, cash-flow, and capital-expenditure variables use raw US dollars; EPS uses US dollars per share. Ratio and percentage variables have their own scales: inspect the metric definition before choosing a threshold.

| Expression | Meaning |
|---|---|
| `market_cap > 2000000000` | Market capitalisation greater than $2 billion |
| `revenue_LTM > 1000000000` | Last-twelve-month revenue greater than $1 billion |
| `return_since_2026_01_01 > 10` | Price increase greater than 10% from the dated price to the latest price, where the required observations exist |
| `ebit_LTM / revenue_LTM > 0.15` | A calculated EBIT margin greater than 15%; the division returns a ratio |

The return variable above uses percentage points, while the calculated margin uses a fraction. Do not copy one threshold scale to the other. Extended provider metrics can use different scales from a ratio you calculate yourself.

## Expression syntax

An expression may contain numbers, supported variables, parentheses, `+`, `-`, `*`, `/`, `%`, `**` or `^`, comparisons (`>`, `>=`, `<`, `<=`, `==`, `!=`), and `and` / `or`. Both power operators mean exponentiation. Prefer a comparison that returns true or false; a bare numeric result is interpreted as pass when non-zero.

Supported helpers include `abs`, `min`, `max`, `sum`, `round`, `len`, `int`, `float`, `bool`, `any`, `all`, `sorted`, `zip`, `enumerate`, `range`, `sqrt`, `log`, `mean`, `median`, and `stdev`. Lists and supported comprehensions can express repeated calculations. This is a restricted expression evaluator, not arbitrary Python: imports, external calls, and additional libraries are unavailable.

Expressions are limited to 2,000 characters. `range` is limited to 10,000 entries and the magnitude of a power exponent to 1,000. Division by zero and unsupported expressions produce an evaluation error.

## Validation and missing data

The web editor validates an expression using one company. A successful validation checks that example, not data coverage or suitability across the full universe. If validation cannot obtain its sample company or required data, inspect the error before changing a financially meaningful expression merely to make it pass.

A company with a missing required quantitative input receives a failed result with a **Missing data for…** reason. The value is not silently treated as zero. Review those reasons separately from a numerical threshold failure, and inspect a sample of both included and excluded companies.

If a required metric is unavailable, [request a coverage review](https://portraitresearch.com/documentation/more/custom-prompt-build/). Include the intended measure, period, and an example company without disclosing credentials or licensed source content.