STRASMORE/EXPLORE 3,214 QUERIES

Yield on cost against current yield, per position

Answered against 22 years of US equities and 12 years of US options data and published with the query that produced it. This result is stored as of 2026-10-08, from Build a Dividend Income Tracker With SQL.

as of ranking 6×3read in context →
Yield on cost against current yield, per position — 6 rows by 3 columns, computed from US exchange, SIP and OPRA data.
tickeryield_on_cost_pctcurrent_yield_pct
O5.276.11
XOM4.282.46
KO3.922.46
JNJ3.452.08
PG3.082.94
MSFT1.460.74
Rows × columns
6 × 3
Computed
Completeness
No missing values
Source
US exchange, SIP and OPRA market data
Licence
Strasmore terms · free, no signup
Formats
JSON · CSV · the SQL below

What each column holds

Column definitions for Yield on cost against current yield, per position, derived from the stored result.
ColumnTypeRangeNotes
ticker text 6 distinct values (JNJ, KO, MSFT…)
yield_on_cost_pct number 1.46 to 5.27 percent
current_yield_pct number 0.74 to 6.11 percent

Computed from Strasmore's warehouse of US exchange, SIP and OPRA market data. Equity prices are delayed; options greeks and implied volatility are end-of-day. This result is stored, not recomputed on load — it is exactly the numbers that were returned on , and the query below is what returned them.

Run it yourself

This is the exact query behind the result above. Change a ticker, a date or a column and run it against the warehouse — no account, no key. The no-signup tier is smaller than the one this page was computed on; a query that reaches past it comes back saying which plan runs it.

WITH holdings AS
(
    SELECT
        tupleElement(h, 1) AS ticker,
        tupleElement(h, 2) AS cost_per_share
    FROM
    (
        SELECT arrayJoin([
            ('KO',    54.10),
            ('PG',   141.25),
            ('JNJ',  155.40),
            ('MSFT', 268.75),
            ('XOM',   96.20),
            ('O',     61.85)
        ]) AS h
    )
),
declared AS
(
    SELECT
        ticker,
        argMax(cash_amount, ex_dividend_date) AS cash_per_payment,
        argMax(frequency, ex_dividend_date)   AS pays_per_year
    FROM global_markets.stocks_dividends
    WHERE ticker IN ('KO', 'PG', 'JNJ', 'MSFT', 'XOM', 'O')
      AND currency = 'USD'
      AND frequency IN (1, 2, 4, 12)
      AND ex_dividend_date >= today() - 400
      AND ex_dividend_date <= today() + 120
    GROUP BY ticker
),
last_px AS
(
    SELECT
        ticker,
        argMax(toFloat64(close), date) AS last_close
    FROM global_markets.stocks_daily_aggs
    WHERE ticker IN ('KO', 'PG', 'JNJ', 'MSFT', 'XOM', 'O')
      AND date >= today() - 45
    GROUP BY ticker
)
SELECT
    h.ticker AS ticker,
    round(toFloat64(d.cash_per_payment) * d.pays_per_year / h.cost_per_share * 100, 2) AS yield_on_cost_pct,
    round(toFloat64(d.cash_per_payment) * d.pays_per_year / p.last_close * 100, 2)     AS current_yield_pct
FROM holdings AS h
INNER JOIN declared AS d ON d.ticker = h.ticker
INNER JOIN last_px  AS p ON p.ticker = h.ticker
ORDER BY yield_on_cost_pct DESC
⌘/Ctrl + Enter

Work with this data in your AI assistant

Opens ready to query, with this page's data. Free, no account.

More from this analysisBuild a Dividend Income Tracker With SQL
Annual dividend income per position, with a running portfolio total ranking 6×3 → What the sample list paid per calendar year, share counts held fixed ranking 5×3 → Projected dividend income by month, next twelve months series 13×4 → Latest declared dividend per share for each sample holding table 6×5 → Pairwise daily return correlation, trailing year ranking 15×2 → S&P 500 tracker distributions per share, by calendar year (2015-2025) ranking 11×3 → See all 3,214 queries →