{"slug":"did-stocks-take-25-years-to-recover","qid":"weighting_contrast","label":"weighting_contrast","post_title":"did-stocks-take-25-years-to-recover","post_url":"/blog/did-stocks-take-25-years-to-recover#q-weighting_contrast","columns":["ticker","price_weight_pct","cap_weight_pct","weight_gap_pct"],"rows":[{"ticker":"CAT","price_weight_pct":34.5,"cap_weight_pct":3.4,"weight_gap_pct":31.1},{"ticker":"MCD","price_weight_pct":9.7,"cap_weight_pct":1.5,"weight_gap_pct":8.2},{"ticker":"JNJ","price_weight_pct":10.8,"cap_weight_pct":5.6,"weight_gap_pct":5.2},{"ticker":"KO","price_weight_pct":3.6,"cap_weight_pct":3.3,"weight_gap_pct":0.3},{"ticker":"VZ","price_weight_pct":1.9,"cap_weight_pct":1.7,"weight_gap_pct":0.2},{"ticker":"WMT","price_weight_pct":4.4,"cap_weight_pct":7.4,"weight_gap_pct":-3},{"ticker":"MSFT","price_weight_pct":21.4,"cap_weight_pct":34,"weight_gap_pct":-12.6},{"ticker":"AAPL","price_weight_pct":13.8,"cap_weight_pct":43.1,"weight_gap_pct":-29.3}],"shape":"ranking","sql":"WITH latest AS\n(\n    SELECT\n        ticker,\n        argMax(toFloat64(price), date)      AS share_price,\n        argMax(toFloat64(market_cap), date) AS cap_value\n    FROM global_markets.stocks_ratios\n    WHERE ticker IN ('AAPL', 'MSFT', 'KO', 'JNJ', 'CAT', 'MCD', 'WMT', 'VZ')\n      AND date >= today() - 90\n      AND price > 0\n      AND market_cap > 0\n    GROUP BY ticker\n)\nSELECT\n    ticker,\n    round(100 * share_price / sum(share_price) OVER (), 1) AS price_weight_pct,\n    round(100 * cap_value / sum(cap_value) OVER (), 1)     AS cap_weight_pct,\n    round(100 * share_price / sum(share_price) OVER ()\n        - 100 * cap_value / sum(cap_value) OVER (), 1)     AS weight_gap_pct\nFROM latest\nORDER BY weight_gap_pct DESC","computed_at":"2026-10-02T15:08:05.184818+00:00","elapsed":0.028781411}