{"template":"peer_ebitda_margin_percentiles","params":{"sic":"3559"},"executed_query":{"sql":"WITH sic AS ( SELECT DISTINCT canonical_id, code, description FROM api.mv_sic WHERE code = %(sic)s OR (%(sic_prefix)s::text IS NOT NULL AND code LIKE %(sic_prefix)s || '%%') ), oi AS ( SELECT DISTINCT ON (v.cik) v.cik, v.value, v.period_end, v.fact_id FROM sic s JOIN api.v_company_financials v ON v.canonical_id = s.canonical_id WHERE v.metric = 'operating_income' AND v.period_start IS NOT NULL AND v.period_end - v.period_start > 300 AND v.period_end >= current_date - 550 ORDER BY v.cik, v.period_end DESC ), grp AS ( SELECT ((o.value + da.value) / rev.value) AS margin, o.fact_id FROM oi o JOIN LATERAL ( SELECT v.value FROM api.v_company_financials v WHERE v.cik = o.cik AND v.metric = 'depreciation_amortization' AND v.period_end BETWEEN o.period_end - 7 AND o.period_end + 7 ORDER BY v.period_end DESC LIMIT 1) da ON true JOIN LATERAL ( SELECT v.value FROM api.v_company_financials v WHERE v.cik = o.cik AND v.metric = 'revenue' AND v.period_start IS NOT NULL AND v.period_end - v.period_start > 300 AND v.period_end BETWEEN o.period_end - 7 AND o.period_end + 7 ORDER BY v.period_end DESC LIMIT 1) rev ON true WHERE rev.value <> 0 AND abs((o.value + da.value) / rev.value) <= 10 ) SELECT count(*)::int AS n_companies, 'ebitda_margin (computed: oi + d&a / revenue)' AS metric, round(min(margin)::numeric, 4) AS p0_min, round(percentile_cont(0.10) WITHIN GROUP (ORDER BY margin)::numeric, 4) AS p10, round(percentile_cont(0.25) WITHIN GROUP (ORDER BY margin)::numeric, 4) AS p25, round(percentile_cont(0.50) WITHIN GROUP (ORDER BY margin)::numeric, 4) AS p50_median, round(percentile_cont(0.75) WITHIN GROUP (ORDER BY margin)::numeric, 4) AS p75, round(percentile_cont(0.90) WITHIN GROUP (ORDER BY margin)::numeric, 4) AS p90, round(max(margin)::numeric, 4) AS p100_max, CASE WHEN %(own_value)s::numeric IS NULL THEN NULL ELSE round(100.0 * (count(*) FILTER (WHERE margin < %(own_value)s)) / count(*)) END AS own_percentile, (array_agg(fact_id::text ORDER BY margin DESC))[1:20] AS sample_fact_ids FROM grp HAVING count(*) > 0","params":{"sic":"3559","sic_prefix":null,"own_value":null}},"n":1,"result":[{"n_companies":13,"metric":"ebitda_margin (computed: oi + d&a / revenue)","p0_min":-1.1211,"p10":-0.269,"p25":0.0579,"p50_median":0.1374,"p75":0.1743,"p90":0.3275,"p100_max":0.3719,"own_percentile":null,"sample_fact_ids":["28258000-a350-47f3-a2ee-7f4dad0cc828","e6271a41-12fc-4575-8139-16f3e46907c5","ed0b91a5-49f1-4074-8121-bb61c2a211eb","c21691cd-a959-4c42-9675-ee4bfd07c869","b31a1f61-9523-4161-99a4-f3e3d2f0f190","31d52358-d3ac-4f05-a84b-ec4621c65d95","6a9dbcd5-a462-4b41-8a00-ae6fdf4ea4a4","dcc9a552-7746-447a-ad9b-740e796486bc","a8266b77-f868-472a-86cf-d347cb4b1fb2","06dd68d0-addf-4820-92d6-e4361b8a9924","226da59e-a4b5-4c14-ac60-167b01ab6164","51fc873c-b710-416f-8ce9-ba13b2b4fe7a","21ecbe3e-f5ac-4cbc-aa9b-46c970f6e637"],"sample_fact_urls":["https://factanker.com/fact/28258000-a350-47f3-a2ee-7f4dad0cc828","https://factanker.com/fact/e6271a41-12fc-4575-8139-16f3e46907c5","https://factanker.com/fact/ed0b91a5-49f1-4074-8121-bb61c2a211eb","https://factanker.com/fact/c21691cd-a959-4c42-9675-ee4bfd07c869","https://factanker.com/fact/b31a1f61-9523-4161-99a4-f3e3d2f0f190","https://factanker.com/fact/31d52358-d3ac-4f05-a84b-ec4621c65d95","https://factanker.com/fact/6a9dbcd5-a462-4b41-8a00-ae6fdf4ea4a4","https://factanker.com/fact/dcc9a552-7746-447a-ad9b-740e796486bc","https://factanker.com/fact/a8266b77-f868-472a-86cf-d347cb4b1fb2","https://factanker.com/fact/06dd68d0-addf-4820-92d6-e4361b8a9924","https://factanker.com/fact/226da59e-a4b5-4c14-ac60-167b01ab6164","https://factanker.com/fact/51fc873c-b710-416f-8ce9-ba13b2b4fe7a","https://factanker.com/fact/21ecbe3e-f5ac-4cbc-aa9b-46c970f6e637"]}],"scope":{"source":"SEC EDGAR (XBRL, as-filed); Summe, Division, percentile_cont in Postgres","ebitda_semantics":"EBITDA GERECHNET als oi + D&A — kein adjusted EBITDA"},"not_claimed":["Nur Firmen mit allen drei Bausteinen im selben Geschäftsjahr.","Adjusted-EBITDA-Angaben der Firmen weichen ab (Non-GAAP).","n_companies < 8: Perzentile grob."],"retrieved_at":"2026-08-29T10:18:09"}