creating-box-plot-insights

Creates and validates box plot insights in PostHog from Trends queries or HogQL.

713|118|Updated Aug 11, 2020
One-click install
npx skills add https://github.com/PostHog/posthog-foss --skill creating-box-plot-insights
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: creating-box-plot-insights
Source: https://github.com/PostHog/posthog-foss/tree/main/products/product_analytics/skills/creating-box-plot-insights
Command: npx skills add https://github.com/PostHog/posthog-foss --skill creating-box-plot-insights

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Building box plot visualizations in PostHog requires distribution data with correct percentile statistics, and mistakes like using pre-aggregated averages or misconfigured chart settings produce invalid or misleading insights. This Skill guides the creation of box plot insights end to end, from choosing the right query type to validating and verifying the saved result.

Core Features & Use Cases

  • Query type selection: Chooses between a standard Trends box plot (event or action with a numeric property) and a SQL-backed box plot for custom grouping, joins, or derived values.
  • SQL validation rules: Enforces required statistics (min, p25, median, mean, p75, max), ordering checks, and limits of 200 series and 10,000 cells before saving.
  • Save and verify workflow: Saves the insight with the correct DataVisualizationNode chart settings, then reads it back and re-runs it to confirm the expected columns and one row per box.
  • Use Case: A user asks to compare request latency distributions across pricing plans over the last 8 weeks. The Skill builds a HogQL query grouping by week and plan, validates the percentile output, saves the box plot insight, and confirms it renders correctly.

Quick Start

Create a box plot insight in PostHog showing the distribution of the latency_ms property for the 'request completed' event grouped by week.

Frequently Asked Questions about creating-box-plot-insights

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a box plot insight in PostHog?

Build an InsightVizNode with a TrendsQuery source, set math_property to a numeric event property, and set trendsFilter.display to BoxPlot. Run the query first, then save it with insight-create and verify it with insight-get.

How do I build a box plot from a SQL query in PostHog?

Write a HogQL query returning one pre-aggregated row per X-axis and series pair with min, p25, median, mean, p75, and max columns. Save it as a DataVisualizationNode with display BoxPlot and chartSettings mapping each statistic column.

When should I use SQL instead of a Trends box plot?

Use SQL when you need custom grouping, joins, or derived values that Trends cannot express. Do not use SQL just to reproduce a standard Trends query, since the standard box plot is simpler for event properties over time intervals.

Why is my PostHog box plot missing some boxes?

PostHog omits individual boxes whose rows have missing or invalid summary statistics while keeping valid boxes visible. Check that every row satisfies min <= p25 <= median <= p75 <= max and that all statistics are numeric.

What are the limits for SQL box plot data in PostHog?

A SQL box plot supports at most 200 series and 10,000 X-axis by series cells. Each X-axis and series pair must appear exactly once, and percentiles must be calculated in the database rather than from limited client-side result rows.