HogQL is the name of our take on SQL. It's effectively a wrapper around ClickHouse SQL, with a few tweaks, such as simplified event and person property access.
HogQL Expressions (BETA)
Right now we have released HogQL Expressions (BETA), which can be used inside insights as filters and/or breakdown values.

Is HogQL real SQL?
HogQL is real SQL. It's a translation layer over ClickHouse SQL, with the features we have enabled.
Strings and quotes
Quotation symbols work the same way they would work with ClickHouse.
- Use
'single quotes'for text strings. - Use backticks (`) or
"double quotes"for columns, properties and aliases with spaces.
Supported ClickHouse functions
The following ClickHouse functions have been enabled. This list is ever expanding. Please submit a Pull Request if we're missing something obvious.
Arithmetic
absmax2min2
Type conversions
All properties are currently accessed as strings. To compare numeric properties, you will need to wrap them with a function like toInt. For example: toInt(properties.$screen_width). This will be automatic soon.
toInttoFloattoDecimaltoDatetoDateTimetoIntervalSecondtoIntervalMinutetoIntervalHourtoIntervalDaytoIntervalWeektoIntervalMonthtoIntervalQuartertoIntervalYeartoString
Date functions
INTERVAL 1 MONTHkeywordnow()toMondaytoStartOfYeartoStartOfQuartertoStartOfMonthtoStartOfWeektoStartOfDaytoStartOfHourtoStartOfMinutetoStartOfSecondtoStartOfFiveMinutestoStartOfTenMinutestoStartOfFifteenMinutestoTimezoneagedateDiffdateTruncformatDateTime
String functions
lengthemptynotEmptyleftPadrightPadlowerupperrepeatformatconcatcoalescesubstringappendTrailingCharIfAbsentendsWithstartsWithtrimtrimLefttrimRightextractTextFromHTMLmatchlikeilikenotLikereplacereplaceOne
Array functions
tuple
Conditional
ifnotmultiIf
Rounding
roundfloorceiltrunc