npx skills add ...
npx skills add posthog/skills --skill tools-and-features-hogql
npx skills add posthog/skills --skill tools-and-features-hogql
HogQL queries for PostHog analytics
This skill helps you write HogQL queries for PostHog analytics. HogQL is PostHog's SQL dialect, a wrapper around ClickHouse SQL with simplified property access and PostHog-specific functions.
references/expressions.md - Sql expressions - docsreferences/aggregations.md - Supported aggregations - docsreferences/clickhouse-functions.md - Supported clickhouse functions - docsreferences/data-access.md - Accessing data using sql - docsreferences/variables.md - Sql variables - docsreferences/useful-functions.md - Useful sql functions - docsreferences/posthog.md - PostHog table schemas (events, persons, groups, sessions)references/sessions.md - Sessions - docsConsult the documentation for SQL syntax, available functions, and query patterns.
properties.$property_name for event properties and person.properties.$property_name for person properties{filters} in queries to allow UI-based filtering in PostHog dashboardscount(), uniq(), avg(), sum()SELECT person.properties.email, count()
FROM events
WHERE {filters}
GROUP BY person.properties.email