creating-box-plot-insights
Fungsinya
Skill ini membuat insight box plot yang menunjukkan sebaran nilai numerik, seperti median dan kuartilnya. Ditujukan untuk analis yang ingin membandingkan bagaimana nilai tersebar di antara tanggal atau kelompok.
Kapan dipakai
- ✓Saat Anda ingin melihat sebaran nilai numerik, seperti ukuran pesanan atau waktu muat.
- ✓Saat Anda ingin membandingkan median atau kuartil antar tanggal atau kelompok.
- ✓Saat Anda memerlukan box plot yang dibuat dari hasil SQL dengan pengelompokan kustom.
Link skill
https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/creating-box-plot-insights/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
“Buatkan box plot berapa lama checkout setiap hari, agar saya bisa melihat sebarannya.”
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill memilih box plot tren standar atau box plot SQL, memastikan nilainya numerik, menjalankan kueri, dan menyimpan insight. Setelah itu, skill membaca kembali insight tersebut untuk memastikannya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Creating box plot insights
Box plots need distribution data, not an already-aggregated average or total. Choose the simplest query type that can express the user's question.
Choose the query type
Use a standard product analytics box plot when all of these are true:
- The source is an event, action, or warehouse table supported by Trends.
- One numeric property contains the values to distribute.
- The user wants the distribution over a normal time interval.
Use a SQL box plot when the user needs custom grouping, joins, derived values, or bespoke SQL. Read querying-posthog-data before writing HogQL, then use references/sql-examples.md as a starting point.
Do not use SQL only to reproduce a standard Trends query.
Standard product analytics box plot
- Identify the event or action and its numeric property. Confirm the property is numeric before saving.
- Build an
InsightVizNodewhose source is aTrendsQuery:- Set the series event or action.
- Set
math_propertyto the numeric property. - Set
trendsFilter.displaytoBoxPlot. - Choose the date range and interval that match the question.
- Run the query with
posthog:query-trends. - If it returns distribution rows, save it with
posthog:insight-create. - Read it back with
posthog:insight-getand confirm the property, interval, and display.
A box plot without a numeric math_property is invalid. Do not substitute event counts unless counts are the values the user wants to distribute.
SQL box plot
The SQL must return one pre-aggregated row for each X-axis and series pair. Calculate the summary in the database. Never calculate percentiles from the limited result rows in the client.
Required numeric roles:
- minimum
- 25th percentile
- median
- mean
- 75th percentile
- maximum
The easiest result shape uses these aliases:
x, series, min, p25, median, mean, p75, max
x and series are optional:
- Set
xAxisColumntonullfor one overall distribution or one box per series. - Set
seriesColumntonullfor one series.
Validate the HogQL with posthog:execute-sql before saving. Check that:
- Every required statistic is numeric.
min <= p25 <= median <= p75 <= maxfor every row.- The mean is between the minimum and maximum.
- Each X-axis and series pair appears once.
- There are at most 200 series and 10,000 X-axis by series cells.
Then save this shape with posthog:insight-create:
{
"query": {
"kind": "DataVisualizationNode",
"source": {
"kind": "HogQLQuery",
"query": "<validated HogQL>"
},
"display": "BoxPlot",
"chartSettings": {
"boxPlot": {
"xAxisColumn": "x",
"seriesColumn": "series",
"minColumn": "min",
"p25Column": "p25",
"medianColumn": "median",
"meanColumn": "mean",
"p75Column": "p75",
"maxColumn": "max",
"excludeOutliers": true
}
}
}
}
Use the actual aliases when the query uses different names. Do not map the six statistics as six Y-axis series.
Verify the saved insight
- Read the saved insight with
posthog:insight-get. - Run it with
posthog:insight-query. - Confirm the result still has the expected columns and one row per box.
- Report the insight link, the numeric value being distributed, and the grouping choices.
If an individual row has a missing or invalid summary, PostHog omits that box while keeping valid boxes visible. Fix the SQL when omitted boxes are not expected.
Related skills
querying-posthog-data- required before authoring or changing the HogQL for a SQL box plot.formatting-insight-axes- use when the value axis needs currency, duration, percentage, or other formatting.building-a-dashboard- use when the box plot should be placed with other insights on a dashboard.
Pertanyaan umum
Kapan sebaiknya saya menggunakan SQL?
Gunakan SQL saat Anda memerlukan pengelompokan kustom, join, atau nilai turunan. Kueri tren standar sudah cukup untuk deret waktu biasa.
Mengapa memerlukan nilai mentah?
Box plot menunjukkan distribusi, bukan total atau rata-rata, sehingga harus menggunakan nilai numerik mentah.
Apakah insight disimpan?
Ya. Setelah kueri mengembalikan baris distribusi, insight disimpan lalu diperiksa.
Detail
Deskripsi asli dari pembuat
Creates product analytics or SQL-backed box plot insights in PostHog. Use when a user asks to create, build, or save a box plot, visualize a numeric distribution, compare quartiles or medians across dates or groups, or turn SQL results into a box plot. Chooses between a standard Trends box plot and a SQL insight, validates the distribution data, saves the insight, and verifies it.
repo: PostHog/posthog
Popularitas
- Bintang GitHub
- 41k
- Peringkat
- #6901
- Lisensi
- —
- Diperbarui
- 2/11/2026
Komentar
- …
Skill lain dari repositori ini
depot-ci
41kMembantu agent Anda menyiapkan dan menjalankan alur kerja Depot CI, alternatif GitHub Actions, termasuk memigrasikan alur kerja yang ada dan membaca log eksekusi.
depot-container-builds
41kMembantu agent Anda membangun image Docker di builder jarak jauh Depot, termasuk image multi-platform, pengiriman ke registry, dan perbaikan kegagalan build.
depot-github-runners
41kMembantu agent Anda memindahkan job GitHub Actions ke runner yang dikelola Depot, memilih ukuran dan label runner, serta memecahkan masalah pengaturan runner.
editing-agents-md
41kMembantu agent Anda memutuskan apakah sebuah aturan layak masuk ke berkas AGENTS.md atau CLAUDE.md, dan menulisnya agar tetap dipatuhi tanpa membuat berkas membengkak.
Skill serupa
gitcrawl
394kMemungkinkan agent Anda mencari arsip issue dan pull request GitHub yang tersimpan, mengelompokkan yang duplikat, dan memeriksa status terkininya di GitHub.
slacrawl
394kMemungkinkan agent Anda mencari dan menghitung pesan di arsip Slack lokal, memeriksa seberapa baru arsip itu, dan menyegarkannya bila diperlukan.
goplaces
394kMembantu agent Anda mencari tempat, mendapatkan detail dan ulasannya, serta menentukan nama tempat memakai Google Places, dengan keluaran JSON untuk skrip.