intermediate
8 minS&P 500 Revenue Growth Screener
Find current S&P 500 companies with a 3-year revenue CAGR above 20%, using the precomputed ratio table and index_membership.
SDKscreeningrevenueDuckDB
## Screen S&P 500 for Revenue Growth
The `ratio` table already carries growth rates such as `revenue_cagr_3y`, one row per company and fiscal year. Join `"references"` for the ticker (filter `is_active AND is_primary_ticker` for one row per company) and `index_membership ON cik = cik` for the current S&P 500 — there is no `is_sp500` flag, so all membership questions go through `index_membership`.
python
from valuein_sdk import ValueinClient, ValueinError try: with ValueinClient() as client: # Current S&P 500 members whose 3-year revenue CAGR (latest fiscal # year, precomputed in the ratio table) is above 20%. results = client.run_query(""" WITH cagr AS ( SELECT entity_id, period_end, value AS cagr_3yr FROM ratio WHERE ratio_name = 'revenue_cagr_3y' AND fiscal_period = 'FY' QUALIFY ROW_NUMBER() OVER ( PARTITION BY entity_id ORDER BY period_end DESC ) = 1 ) SELECT r.symbol, r.name, r.sector, c.period_end, ROUND(c.cagr_3yr, 4) AS cagr_3yr FROM cagr c JOIN "references" r ON r.cik = c.entity_id JOIN index_membership im ON im.cik = r.cik WHERE im.index_name = 'SP500' AND im.removal_date IS NULL AND r.is_active AND r.is_primary_ticker AND c.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 period_end cagr_3yr
0 SMCI Super Micro Computer, Inc. Information Technology 2026-06-30 0.7634
1 NVDA NVIDIA CORP Information Technology 2025-01-26 0.6925
2 LVS LAS VEGAS SANDS CORP Consumer Discretionary 2023-12-31 0.5223
3 KKR KKR & Co. Inc. Financials 2025-12-31 0.5055
4 RDDT Reddit, Inc. Information Technology 2025-12-31 0.4893
5 HOOD Robinhood Markets, Inc. Financials 2025-12-31 0.4879
6 SNDK Sandisk Corp Information Technology 2026-07-03 0.4485
7 APO Apollo Global Management, Inc. Financials 2025-12-31 0.4296
...Try it yourself
Every snippet runs on the free sample with no token. Add one to run this notebook against all 120.5M+ SEC EDGAR facts.