Explore more topics
Market-data lake

lake.sec_quarterly_financials dataset schema

Column types and research semantics for NexusTrade’s lake.sec_quarterly_financials dataset. Read the supported schema before submitting a bounded SQL query.

Jump to a section

TL;DR

Apply the decision-time availability cutoff before selecting the latest financial revision for each fiscal period. Otherwise a restatement can introduce information that was still future at the decision date. These SEC quarterly rows retain native currency and source provenance; use canonical statements for USD comparisons. Keep period end, availability, filing identity and any constructed quarterly cash-flow or revenue calculation distinct when building a historical series.

Query name
lake.sec_quarterly_financials
Storage partition
year
Columns
34

Why cutoff comes before revision selection

Original value 100

Available date

January 15

Eligible at February 1?

Yes

Revised value 110

Available date

February 15

Eligible at February 1?

No

Hypothetical inputs demonstrate availability ordering; no SQL output is fabricated.

Show the table · 2 rows, 3 columns

Scroll sideways to compare all columns. Select a heading to sort.

Original value 100January 15Yes
Revised value 110February 15No

Hypothetical inputs demonstrate availability ordering; no SQL output is fabricated.

Illustrative version history, not actual company rows: the same fiscal period has value 100 available January 15 and a revised value 110 available February 15. A February 1 decision may use 100; selecting 110 before applying the availability cutoff would use future information.

What this table contains

Native-currency SEC XBRL quarterly statements. Prefer `canonical_quarterly_financials` for USD comparisons and backtest parity. `date` carries the saved availability timestamp; inspect `availabilitySource` and filing provenance for its basis.

Select financial revisions before a decision cutoff

Query example, not executed here. The dates and filters define the proposed research scope; returned rows and current coverage must be checked in your workspace.

The availability cutoff runs before ROW_NUMBER selects the latest eligible revision for each period. date is availability; periodEnd is the reported period. The fallback period key uses the saved date when periodEnd is NULL. Native-currency values require the reportingCurrency field for comparisons.

SQL
SELECT ticker, name, periodEnd, date, filed, totalRevenue, accession
FROM lake.sec_quarterly_financials
WHERE ticker = 'AAPL'
  AND date < TIMESTAMP '2026-09-19'
QUALIFY ROW_NUMBER() OVER (
  PARTITION BY ticker, COALESCE(CAST(periodEnd AS DATE), CAST(date AS DATE))
  ORDER BY filed DESC NULLS LAST, date DESC, accession DESC
) = 1
ORDER BY periodEnd DESC NULLS LAST, date DESC
LIMIT 20;

Submit the sec_quarterly_financials example and read back its parts

Run the exact SQL through the Python SDK

Save this page's SQL as query.sql and the runner below as query.py. Use a registered key with lake scope from Developers. The runner submits the displayed sec_quarterly_financials query once, saves its operation, waits on that same ID, saves the returned manifest and downloads its Parquet parts.

This submission has not been executed for the reference page. Inspect the SQL, dates and resource limits before running it. Reuse the request key only for this identical SQL and limits; use a new key when changing them.

Shell
python3 -m pip install nexustrade==1.42.0
export NEXUSTRADE_API_KEY="YOUR_LAKE_SCOPED_KEY"
python3 query.py

Python
import json
from pathlib import Path
from nexustrade import NexusTradeClient

# Save the SQL displayed on this page as query.sql.
sql = Path("query.sql").read_text()
client = NexusTradeClient.from_environment()
operation = client.create_lake_query(
    {"query": sql, "limits": {"timeoutSeconds": 30, "maxRows": 50,
                              "maxResultBytes": 1048576}},
    idempotency_key="reference-sec_quarterly_financials-20261012-v1",
)
Path("query-operation.json").write_text(json.dumps(operation, indent=2))
finished = client.wait_for_lake_query(operation["id"])
if finished["status"] != "completed":
    raise RuntimeError(finished)
manifest = client.get_lake_query_manifest(operation["id"])["result"]
Path("query-manifest.json").write_text(json.dumps(manifest, indent=2))
print(json.dumps(manifest, indent=2))
for part in manifest["parts"]:
    Path(f"query-{part['part']}.parquet").write_bytes(
        client.download_lake_query_part(operation["id"], part["part"], max_bytes=1048576)
    )

Columns and types

VARCHAR

  • ticker
  • symbol
  • name

TIMESTAMP

  • date

DOUBLE

  • totalRevenue
  • netIncome
  • ebitda
  • grossProfit
  • freeCashFlow
  • totalAssets
  • totalLiab
  • commonStockSharesOutstanding

Showing 12 of 34 recorded rows. The complete table is below.

Current logical schema for lake.sec_quarterly_financials

Inspect the complete lake.sec_quarterly_financials schema

Scroll sideways to compare all columns. Select a heading to sort.

tickerVARCHAR
symbolVARCHAR
dateTIMESTAMP
nameVARCHAR
totalRevenueDOUBLE
netIncomeDOUBLE
ebitdaDOUBLE
grossProfitDOUBLE
freeCashFlowDOUBLE
totalAssetsDOUBLE
totalLiabDOUBLE
commonStockSharesOutstandingDOUBLE
shortTermDebtDOUBLE
longTermDebtDOUBLE
operatingIncomeDOUBLE
operatingCashFlowDOUBLE
capitalExpendituresDOUBLE
filedTIMESTAMP
periodEndTIMESTAMP
availabilitySourceVARCHAR
cikBIGINT
accessionVARCHAR
rawArchiveKeyVARCHAR
rawSha256VARCHAR
sourceFilingUrlVARCHAR
quarterlyFlowProvenanceVARCHAR
revenueDerivationVARCHAR
filedValueCorrectionsVARCHAR
filedPeriodCorrectionVARCHAR
reportingCurrencyVARCHAR
periodStartTIMESTAMP
taxonomyVARCHAR
fiscalYearBIGINT
fiscalPeriodVARCHAR

Current logical schema for lake.sec_quarterly_financials

Query lake.sec_quarterly_financials using the column names and types below. The query validator and engine use this logical catalog; a field absent from an older shard returns typed NULL.

Coverage and timing

Inspect source coverage and timing before using the rows

Native-currency SEC XBRL quarterly statements. Prefer `canonical_quarterly_financials` for USD comparisons and backtest parity. `date` carries the saved availability timestamp; inspect `availabilitySource` and filing provenance for its basis.

SEC XBRL quarterly fundamentals. The row key includes `accession`, so one period can appear more than once — a restatement is a second row, not an update.

Collapse to the latest revision before any TTM, CAGR, or per-period aggregate: `QUALIFY ROW_NUMBER() OVER (PARTITION BY ticker, cast(periodEnd as date) ORDER BY filed DESC, date DESC) = 1`. Partition by `cast(date as date)` instead when `periodEnd` is null.

`revenueDerivation` records the exact inputs to constructed Q4 revenue (`annual_minus_prior_quarters`: the annual and Q1–Q3 rows; `annual_minus_nine_month_ytd`: the annual row and the nine-month year-to-date fact, used when Q1–Q3 were not all filed before the 10-K), including retained direct/composed raw fact identities. Values in this JSON remain in native reporting units even on USD canonical rows. Cash-flow revisions preserve this revenue origin; NULL on legacy shards means unknown provenance.

`quarterlyFlowProvenance` is JSON for YTD-subtracted operating cash flow or capex, including both SEC input facts and their filing identities. A later revision also records its original base filing. It does not yet describe FY-minus-prior-quarters Q4 synthesis. NULL on an older shard does not establish that a flow was directly reported.

Fiscal labels and interval metadata can be NULL on older shards. `reportingCurrency` identifies the native monetary unit; use canonical statements for USD comparisons. Has no `sector` or `industry` column. Use `year(cast(date as date))` for an availability calendar year, `stock_industries` for boolean theme tags, and `index_constituents` for GICS-style sector and industry strings.

Discussion

Sign in or create a free account to join the discussion.

No comments yet.