SemVer Flattener

Last updated:

|Edit this page

The SemVer Flattener splits a valid SemVer version into the following

export interface VersionParts {
major: number
minor: number
patch?: number
preRelease?: string
build?: string

And then flattens them onto an event. So, this...

properties: {
app_version: '22.7.11'

Becomes this...

properties: {
app_version: '22.7.11'
app_version__major: 22,
app_version__minor: 7,
app_version__patch: 11

This is especially helpful for comparing versions when filtering in PostHog insights, as it isn't possible to correctly use string comparison in all situations.


Using this requires either PostHog Cloud with the data pipeline add-on, or a self-hosted PostHog instance running version 1.30.0 or later.

Self-hosting and not running 1.30.0? Find out how to update your self-hosted PostHog deployment.


  1. In PostHog, click the "Data pipeline" tab in the left sidebar.
  2. Search for 'SemVer Flattener' and select the transformation, press Install.

That's it!


Is the source code for this transformation available?

PostHog is open-source and so are all transformations on the platform. The source code for the SemVer Flattener is available on GitHub.

Who created this transformation?

We'd like to thank PostHog team member Paul D'Ambra for creating this transformation. Cheers, Paul!

Who maintains this?

This is maintained by PostHog. If you have issues with it not functioning as intended, please let us know!

What if I have feedback on this destination?

We love feature requests and feedback. Please tell us what you think..

What if my question isn't answered above?

We love answering questions. Ask us anything via our community forum.


Was this page useful?