Select one scope

Reference · Three things to know before you query · Documentation

Updated

Browse documentation
On this page

Earlier command and setup reference · Engine 18.6.0rc590 / Reader 8.11.0rc649

Definition

A scope_id is one analysis window and one evidence stream. The same object or person appears in several scopes, so select one scope before you count or sum.

Inspect scopes before aggregating

The same object can contribute to several analysis scopes. Start by examining how rows are distributed:

SELECT scope_id, COUNT(*) AS object_rows
FROM objects
GROUP BY scope_id;

The counts alone do not identify a window or evidence stream. Inspect their published labels before choosing a scope:

SELECT scope_id, analysis_window, analysis_domain
FROM analysis_windows;

Match the chosen window and evidence stream to its scope_id in the count inventory. A count across all scopes can count an object more than once.

Filter the requested population

Filter with WHERE scope_id = ..., using the chosen published value, before counting objects or summing a measure. Keep that same scope explicit when comparing tables. The query above is a scope inventory, not an organisation-wide count of unique objects. Consult the table and column reference for the meaning of the measure you plan to aggregate.