You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Insight SQL to get the average time users spent on mobile screen. Previously using this query works (about a month ago)
SELECT date as time, avg(distinct time_on_screen) AS avg_time_on_screen,
gender
FROM (
SELECT
toDate(first_timestamp) as date,
sum(dateDiff('second', first_timestamp, next_timestamp)) over (PARTITION by date, gender,user_id) AS time_on_screen,
gender,
user_id,
FROM (
SELECT
distinct_id,
event AS first_event,
timestamp AS first_timestamp,
first_value(event) OVER w AS next_event,
first_value(timestamp) OVER w AS next_timestamp,
properties.$screen_name as screen,
properties.page as page,
person.properties.gender as gender,
person.id as user_id,
FROM events
WHERE
timestamp > now() - INTERVAL 14 DAY
WINDOW w AS (PARTITION BY distinct_id ORDER BY timestamp ASC ROWS BETWEEN 1 FOLLOWING AND 1 FOLLOWING)
ORDER BY distinct_id, timestamp
) AS subquery
WHERE first_event = 'restaurant_view'
AND (next_event = '$app_close' OR next_event = '$screen')
)
group by time,gender
ORDER BY time,gender
But now it gives me Unsupported function call 'FROM(...)' error
Okay, found the issue.
Removing comma from user_id, into user_id makes it working again. Though I'm not sure why it is not consistent for trailing commas, since person.id as user_id, works without error.
Leaving this open in case someone else has the same problem.
Bug Description
Bug description
I am using Insight SQL to get the average time users spent on mobile screen. Previously using this query works (about a month ago)
But now it gives me Unsupported function call 'FROM(...)' error

Debug info
- [x] PostHog Cloud, Debug information: Session: https://us.posthog.com/project/sTMFPsFhdP1Ssg/replay/019528a5-6326-7315-aa6e-320bcc4945f1?t=368 Admin: http://go/adminOrgUS/0193d327-b5c8-0000-b979-4444ef04a5fd (project ID 111920) Sentry: http://go/sentryUS/111920
The text was updated successfully, but these errors were encountered: