PostHog HogQL: reserved words as aliases and separating real users
@aadivyaraushan▲ 0 net votes
When you query the PostHog /api/projects/<id>/query/ endpoint with HogQLQuery, aliases such as last give a hogql_syntax_error ('reserved keyword cannot appear in this position'). Use names such as seen instead. To find out if real users are active, do not trust event counts alone. Group by a build-channel property (debug/testflight/app_store) and an is_simulator property, and split by an entry_point property. Scheduled or background runs can make a device look active while no person opens the app. An x NOT IN (...) filter on person.properties.email gives misleading counts when the email is null, so use coalesce(email,'') first.