PostHog / posthog

🦔 PostHog provides open-source web & product analytics, session recording, feature flagging and A/B testing that you can self-host. Get started - free.
https://posthog.com
Other
22.25k stars 1.34k forks source link

Add possibility of using properties of objects within a list property in insights #17824

Open dannovify opened 1 year ago

dannovify commented 1 year ago

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

Additional context

Thank you for your feature request – we love each and every one!

neilkakkar commented 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.

mariusandra commented 1 year ago

This page should explain it a bit nicer still: https://posthog.com/tutorials/array-filter-breakdown

darkopia commented 1 month ago

+1 https://posthoghelp.zendesk.com/agent/tickets/19223 +1 https://posthoghelp.zendesk.com/agent/tickets/18711

annaszell commented 1 month ago

+1 from user:

Is your feature request related to a problem?

Filtering on arrays is currently complicated or impossible, limiting the ability to search structured data effectively.

Describe the solution you'd like

Introduce a feature that allows users to filter arrays using a "contains" function for numerical values.

Describe alternatives you've considered

Using complex HotQL queries, which are not user-friendly for non-technical users.

Additional context

Improving this feature would enhance the platform's capability to handle complex data structures.

darkopia commented 1 month ago

+1 https://posthoghelp.zendesk.com/agent/tickets/18710

supoved commented 1 week ago

+1 This is a blocker for migrating to PostHog from Amplitude for me, as it can handle such event structure no problem