본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트41k · #6901

creating-box-plot-insights

하는 일

이 스킬은 중앙값과 사분위수 같은 숫자 값의 분포를 보여 주는 박스 플롯 인사이트를 만듭니다. 날짜나 그룹에 걸쳐 값이 어떻게 퍼져 있는지 비교하려는 분석가를 위한 것입니다.

사용하는 경우

  • ✓주문 규모나 로드 시간처럼 숫자 값이 어떻게 퍼져 있는지 보고 싶을 때.
  • ✓날짜나 그룹에 걸쳐 중앙값이나 사분위수를 비교하고 싶을 때.
  • ✓사용자 지정 그룹화가 있는 SQL 결과로 만든 박스 플롯이 필요할 때.

스킬 링크

https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/creating-box-plot-insights/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/creating-box-plot-insights/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“매일 체크아웃에 얼마나 걸리는지 박스 플롯으로 만들어서 퍼짐을 볼 수 있게 해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

표준 트렌드 박스 플롯이나 SQL 박스 플롯 중 하나를 고르고, 값이 숫자인지 확인한 뒤, 쿼리를 실행하고 인사이트를 저장합니다. 그다음 다시 읽어 확인합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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

  1. Identify the event or action and its numeric property. Confirm the property is numeric before saving.
  2. Build an InsightVizNode whose source is a TrendsQuery:
    • Set the series event or action.
    • Set math_property to the numeric property.
    • Set trendsFilter.display to BoxPlot.
    • Choose the date range and interval that match the question.
  3. Run the query with posthog:query-trends.
  4. If it returns distribution rows, save it with posthog:insight-create.
  5. Read it back with posthog:insight-get and 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 xAxisColumn to null for one overall distribution or one box per series.
  • Set seriesColumn to null for one series.

Validate the HogQL with posthog:execute-sql before saving. Check that:

  • Every required statistic is numeric.
  • min <= p25 <= median <= p75 <= max for 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

  1. Read the saved insight with posthog:insight-get.
  2. Run it with posthog:insight-query.
  3. Confirm the result still has the expected columns and one row per box.
  4. 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.
자주 묻는 질문

언제 SQL을 써야 하나요?

사용자 지정 그룹화, 조인, 파생 값이 필요할 때 SQL을 씁니다. 일반적인 시계열에는 표준 트렌드 쿼리로 충분합니다.

왜 원시 값이 필요한가요?

박스 플롯은 합계나 평균이 아니라 분포를 보여 주므로, 원시 숫자 값을 써야 합니다.

인사이트를 저장하나요?

네. 분포 행을 반환한 쿼리 뒤에 인사이트가 저장되고, 그다음 확인됩니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
41k
순위
#6901
라이선스
—
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬