intermediate
8 minS&P500 Revenue Growth Screener
Find all S&P500 companies with 3-year revenue CAGR above 20% by joining references with index_membership.
SDKscreeningrevenueDuckDB
## Screen S&P500 for Revenue Growth
Use the `references` table for one row per security, then `JOIN index_membership ON cik = cik` to filter the current S&P500 universe (the `is_sp500` flag was dropped 2026-05-02 — it was snapshot-only and single-index, so all membership questions go through `index_membership`).
python
from valuein_sdk import ValueinClient, ValueinError
try:
with ValueinClient() as client:
results = client.run_query("""
WITH rev AS (
SELECT
entity_id,
MAX(CASE WHEN fiscal_year = 2024 THEN numeric_value END) AS rev_2024,
MAX(CASE WHEN fiscal_year = 2021 THEN numeric_value END) AS rev_2021
FROM fact
WHERE standard_concept = 'TotalRevenue'
AND fiscal_period = 'FY'
GROUP BY entity_id
)
SELECT
r.symbol, r.name, r.sector,
ROUND(rev.rev_2024 / 1e9, 2) AS rev_2024_bn,
ROUND(
POWER(rev.rev_2024 / NULLIF(rev.rev_2021, 0), 1.0/3) - 1,
4
) AS cagr_3yr
FROM rev
JOIN references r ON rev.entity_id = r.cik
JOIN index_membership im ON im.cik = r.cik
WHERE im.index_name = 'SP500'
AND im.removal_date IS NULL
AND cagr_3yr > 0.20
ORDER BY cagr_3yr DESC
LIMIT 20
""")
print(results.to_string())
except ValueinError as e:
print(f"Error: {e}")Output
symbol name sector rev_2024_bn cagr_3yr
0 NVDA NVIDIA Corp Technology 130.50 0.5901
1 SMCI Super Micro Computer Technology 14.94 0.4823
2 DECK Deckers Outdoor Consumer 4.28 0.2312
...Try it yourself
Get your API token and run this notebook against 105M+ real SEC EDGAR facts.