Open dannovify opened 1 year ago
Hey @dannovify , until HogQL supports this natively, you can do the following:
HogQL supports native clickhouse json, so you can still try to access those nested properties. It's just that the syntax isn't as nice. You'll have to keep doing JSONExtractArray
or JSONExtractRaw
until you get to your value. Check out clickhouse docs to see how to use these functions.
This page should explain it a bit nicer still: https://posthog.com/tutorials/array-filter-breakdown
+1 from user:
Filtering on arrays is currently complicated or impossible, limiting the ability to search structured data effectively.
Introduce a feature that allows users to filter arrays using a "contains" function for numerical values.
Using complex HotQL queries, which are not user-friendly for non-technical users.
Improving this feature would enhance the platform's capability to handle complex data structures.
+1 This is a blocker for migrating to PostHog from Amplitude for me, as it can handle such event structure no problem
Is your feature request related to a problem?
I am sending a list of products represented as objects inside the order property. Currently, I cannot access any of the individual fields of each order to use it as a filter or as a break down.
Some simple thing like contains within products work, but doing anything more advanced like aggregations or calculations on 3rd level of properties does not seem to be supported.
Describe the solution you'd like
Have a new type of properties: list and object, that would allow me to select the filter as follows:
Describe alternatives you've considered
properties.products.product_name = 'hog'
Additional context
Thank you for your feature request – we love each and every one!