Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(hogql): strip toTimeZone from timestamp bounds nested in calls (#106420)

Andy Zhaof275a3835a2b
diff --git a/posthog/hogql/database/schema/util/test/__snapshots__/test_session_v2_where_clause_extractor.ambr b/posthog/hogql/database/schema/util/test/__snapshots__/test_session_v2_where_clause_extractor.ambr
index c06874ca8dd3..d43d586e855e 100644
--- a/posthog/hogql/database/schema/util/test/__snapshots__/test_session_v2_where_clause_extractor.ambr
+++ b/posthog/hogql/database/schema/util/test/__snapshots__/test_session_v2_where_clause_extractor.ambr
@@ -145,7 +145,7 @@
GROUP BY
raw_sessions.session_id_v7) AS e__session ON equals(e.`$session_id_uuid`, e__session.session_id_v7)
WHERE
- and(equals(e.team_id, <TEAM_ID>), and(greaterOrEquals(toTimeZone(e.timestamp, %(hogql_val_19)s), toStartOfDay(assumeNotNull(toDateTime(%(hogql_val_20)s, %(hogql_val_21)s)))), lessOrEquals(toTimeZone(e.timestamp, %(hogql_val_22)s), assumeNotNull(toDateTime(%(hogql_val_23)s, %(hogql_val_24)s))), equals(e.event, %(hogql_val_25)s), in(if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id), (SELECT
+ and(equals(e.team_id, <TEAM_ID>), and(greaterOrEquals(e.timestamp, toDateTime64(toStartOfDay(assumeNotNull(toDateTime(%(hogql_val_19)s, %(hogql_val_20)s))), 9, %(hogql_val_21)s)), lessOrEquals(e.timestamp, assumeNotNull(toDateTime(%(hogql_val_22)s, %(hogql_val_23)s))), equals(e.event, %(hogql_val_24)s), in(if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id), (SELECT
cohortpeople.person_id AS person_id
FROM
cohortpeople
diff --git a/posthog/hogql/database/schema/util/test/__snapshots__/test_session_v2_where_clause_extractor.new_events_schema.ambr b/posthog/hogql/database/schema/util/test/__snapshots__/test_session_v2_where_clause_extractor.new_events_schema.ambr
index bf9891fe5e5a..9934d6405c6d 100644
--- a/posthog/hogql/database/schema/util/test/__snapshots__/test_session_v2_where_clause_extractor.new_events_schema.ambr
+++ b/posthog/hogql/database/schema/util/test/__snapshots__/test_session_v2_where_clause_extractor.new_events_schema.ambr
@@ -99,7 +99,7 @@
GROUP BY
raw_sessions.session_id_v7) AS e__session ON equals(toUInt128(toUUIDOrNull(e.properties.`$session_id`)), e__session.session_id_v7)
WHERE
- and(equals(e.team_id, <TEAM_ID>), and(greaterOrEquals(toTimeZone(e.timestamp, %(hogql_val_19)s), toStartOfDay(assumeNotNull(toDateTime(%(hogql_val_20)s, %(hogql_val_21)s)))), lessOrEquals(toTimeZone(e.timestamp, %(hogql_val_22)s), assumeNotNull(toDateTime(%(hogql_val_23)s, %(hogql_val_24)s))), equals(e.event, %(hogql_val_25)s), in(if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id), (SELECT
+ and(equals(e.team_id, <TEAM_ID>), and(greaterOrEquals(e.timestamp, toDateTime64(toStartOfDay(assumeNotNull(toDateTime(%(hogql_val_19)s, %(hogql_val_20)s))), 9, %(hogql_val_21)s)), lessOrEquals(e.timestamp, assumeNotNull(toDateTime(%(hogql_val_22)s, %(hogql_val_23)s))), equals(e.event, %(hogql_val_24)s), in(if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id), (SELECT
cohortpeople.person_id AS person_id
FROM
cohortpeople
diff --git a/posthog/hogql/database/schema/util/test/__snapshots__/test_session_v3_where_clause_extractor.ambr b/posthog/hogql/database/schema/util/test/__snapshots__/test_session_v3_where_clause_extractor.ambr
index 2384dd74b005..f2e06f7008c8 100644
--- a/posthog/hogql/database/schema/util/test/__snapshots__/test_session_v3_where_clause_extractor.ambr
+++ b/posthog/hogql/database/schema/util/test/__snapshots__/test_session_v3_where_clause_extractor.ambr
@@ -117,7 +117,7 @@
GROUP BY
raw_sessions_v3.session_id_v7) AS e__session ON equals(e.`$session_id_uuid`, e__session.session_id_v7)
WHERE
- and(equals(e.team_id, <TEAM_ID>), and(greaterOrEquals(toTimeZone(e.timestamp, %(hogql_val_19)s), toStartOfDay(assumeNotNull(toDateTime(%(hogql_val_20)s, %(hogql_val_21)s)))), lessOrEquals(toTimeZone(e.timestamp, %(hogql_val_22)s), assumeNotNull(toDateTime(%(hogql_val_23)s, %(hogql_val_24)s))), equals(e.event, %(hogql_val_25)s), in(if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id), (SELECT
+ and(equals(e.team_id, <TEAM_ID>), and(greaterOrEquals(e.timestamp, toDateTime64(toStartOfDay(assumeNotNull(toDateTime(%(hogql_val_19)s, %(hogql_val_20)s))), 9, %(hogql_val_21)s)), lessOrEquals(e.timestamp, assumeNotNull(toDateTime(%(hogql_val_22)s, %(hogql_val_23)s))), equals(e.event, %(hogql_val_24)s), in(if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id), (SELECT
cohortpeople.person_id AS person_id
FROM
cohortpeople
diff --git a/posthog/hogql/database/schema/util/test/__snapshots__/test_session_v3_where_clause_extractor.new_events_schema.ambr b/posthog/hogql/database/schema/util/test/__snapshots__/test_session_v3_where_clause_extractor.new_events_schema.ambr
index e58012ef05b7..a21d059ec7dd 100644
--- a/posthog/hogql/database/schema/util/test/__snapshots__/test_session_v3_where_clause_extractor.new_events_schema.ambr
+++ b/posthog/hogql/database/schema/util/test/__snapshots__/test_session_v3_where_clause_extractor.new_events_schema.ambr
@@ -52,7 +52,7 @@
GROUP BY
raw_sessions_v3.session_id_v7) AS e__session ON equals(toUInt128(toUUIDOrNull(e.properties.`$session_id`)), e__session.session_id_v7)
WHERE
- and(equals(e.team_id, <TEAM_ID>), and(greaterOrEquals(toTimeZone(e.timestamp, %(hogql_val_19)s), toStartOfDay(assumeNotNull(toDateTime(%(hogql_val_20)s, %(hogql_val_21)s)))), lessOrEquals(toTimeZone(e.timestamp, %(hogql_val_22)s), assumeNotNull(toDateTime(%(hogql_val_23)s, %(hogql_val_24)s))), equals(e.event, %(hogql_val_25)s), in(if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id), (SELECT
+ and(equals(e.team_id, <TEAM_ID>), and(greaterOrEquals(e.timestamp, toDateTime64(toStartOfDay(assumeNotNull(toDateTime(%(hogql_val_19)s, %(hogql_val_20)s))), 9, %(hogql_val_21)s)), lessOrEquals(e.timestamp, assumeNotNull(toDateTime(%(hogql_val_22)s, %(hogql_val_23)s))), equals(e.event, %(hogql_val_24)s), in(if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id), (SELECT
cohortpeople.person_id AS person_id
FROM
cohortpeople
diff --git a/posthog/hogql/database/schema/util/test/__snapshots__/test_session_where_clause_extractor.ambr b/posthog/hogql/database/schema/util/test/__snapshots__/test_session_where_clause_extractor.ambr
index ae15eee57b74..17b83c346092 100644
--- a/posthog/hogql/database/schema/util/test/__snapshots__/test_session_where_clause_extractor.ambr
+++ b/posthog/hogql/database/schema/util/test/__snapshots__/test_session_where_clause_extractor.ambr
@@ -73,7 +73,7 @@
sessions.session_id,
sessions.session_id) AS e__session ON equals(e.`$session_id`, e__session.session_id)
WHERE
- and(equals(e.team_id, <TEAM_ID>), and(greaterOrEquals(toTimeZone(e.timestamp, %(hogql_val_21)s), toStartOfDay(assumeNotNull(toDateTime(%(hogql_val_22)s, %(hogql_val_23)s)))), lessOrEquals(toTimeZone(e.timestamp, %(hogql_val_24)s), assumeNotNull(toDateTime(%(hogql_val_25)s, %(hogql_val_26)s))), equals(e.event, %(hogql_val_27)s), in(if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id), (SELECT
+ and(equals(e.team_id, <TEAM_ID>), and(greaterOrEquals(e.timestamp, toDateTime64(toStartOfDay(assumeNotNull(toDateTime(%(hogql_val_21)s, %(hogql_val_22)s))), 9, %(hogql_val_23)s)), lessOrEquals(e.timestamp, assumeNotNull(toDateTime(%(hogql_val_24)s, %(hogql_val_25)s))), equals(e.event, %(hogql_val_26)s), in(if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id), (SELECT
cohortpeople.person_id AS person_id
FROM
cohortpeople
diff --git a/posthog/hogql/database/schema/util/test/__snapshots__/test_session_where_clause_extractor.new_events_schema.ambr b/posthog/hogql/database/schema/util/test/__snapshots__/test_session_where_clause_extractor.new_events_schema.ambr
index f3740ce1e3c2..f857f37323fd 100644
--- a/posthog/hogql/database/schema/util/test/__snapshots__/test_session_where_clause_extractor.new_events_schema.ambr
+++ b/posthog/hogql/database/schema/util/test/__snapshots__/test_session_where_clause_extractor.new_events_schema.ambr
@@ -53,7 +53,7 @@
sessions.session_id,
sessions.session_id) AS e__session ON equals(e.properties.`$session_id`, e__session.session_id)
WHERE
- and(equals(e.team_id, <TEAM_ID>), and(greaterOrEquals(toTimeZone(e.timestamp, %(hogql_val_21)s), toStartOfDay(assumeNotNull(toDateTime(%(hogql_val_22)s, %(hogql_val_23)s)))), lessOrEquals(toTimeZone(e.timestamp, %(hogql_val_24)s), assumeNotNull(toDateTime(%(hogql_val_25)s, %(hogql_val_26)s))), equals(e.event, %(hogql_val_27)s), in(if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id), (SELECT
+ and(equals(e.team_id, <TEAM_ID>), and(greaterOrEquals(e.timestamp, toDateTime64(toStartOfDay(assumeNotNull(toDateTime(%(hogql_val_21)s, %(hogql_val_22)s))), 9, %(hogql_val_23)s)), lessOrEquals(e.timestamp, assumeNotNull(toDateTime(%(hogql_val_24)s, %(hogql_val_25)s))), equals(e.event, %(hogql_val_26)s), in(if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id), (SELECT
cohortpeople.person_id AS person_id
FROM
cohortpeople
diff --git a/posthog/hogql/test/__snapshots__/test_query.ambr b/posthog/hogql/test/__snapshots__/test_query.ambr
index 9f3bbee40503..a86b1811ef95 100644
--- a/posthog/hogql/test/__snapshots__/test_query.ambr
+++ b/posthog/hogql/test/__snapshots__/test_query.ambr
@@ -10,7 +10,7 @@
GROUP BY fp_hash
HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0)
SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, %(hogql_val_0)s), ''), 'null'), '^"|"$', '')), events__fingerprint_issue_state.fp_hash)
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, %(hogql_val_13)s), isNotNull(events__fingerprint_issue_state.issue_id), or(and(greater(toTimeZone(events.timestamp, %(hogql_val_14)s), parseDateTime64BestEffort(%(hogql_val_15)s, 6, %(hogql_val_16)s)), less(toTimeZone(events.timestamp, %(hogql_val_17)s), parseDateTime64BestEffort(%(hogql_val_18)s, 6, %(hogql_val_19)s))), and(greater(toTimeZone(events.timestamp, %(hogql_val_20)s), toDateTime(%(hogql_val_21)s, %(hogql_val_22)s)), less(toTimeZone(events.timestamp, %(hogql_val_23)s), toDateTime64(%(hogql_val_24)s, 6, %(hogql_val_25)s))))))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, %(hogql_val_13)s), isNotNull(events__fingerprint_issue_state.issue_id), or(and(greater(events.timestamp, parseDateTime64BestEffort(%(hogql_val_14)s, 6, %(hogql_val_15)s)), less(events.timestamp, parseDateTime64BestEffort(%(hogql_val_16)s, 6, %(hogql_val_17)s))), and(greater(events.timestamp, toDateTime(%(hogql_val_18)s, %(hogql_val_19)s)), less(events.timestamp, toDateTime64(%(hogql_val_20)s, 6, %(hogql_val_21)s))))))
GROUP BY events__fingerprint_issue_state.issue_id
ORDER BY occurrences DESC
LIMIT 51
diff --git a/posthog/hogql/test/__snapshots__/test_query.new_events_schema.ambr b/posthog/hogql/test/__snapshots__/test_query.new_events_schema.ambr
index 06b833d59e47..04da2fe0831d 100644
--- a/posthog/hogql/test/__snapshots__/test_query.new_events_schema.ambr
+++ b/posthog/hogql/test/__snapshots__/test_query.new_events_schema.ambr
@@ -10,7 +10,7 @@
GROUP BY fp_hash
HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0)
SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$exception_fingerprint`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$exception_fingerprint`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$exception_fingerprint`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$exception_fingerprint`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$exception_fingerprint`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$exception_fingerprint`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`)))))), events__fingerprint_issue_state.fp_hash)
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, %(hogql_val_12)s), isNotNull(events__fingerprint_issue_state.issue_id), or(and(greater(toTimeZone(events.timestamp, %(hogql_val_13)s), parseDateTime64BestEffort(%(hogql_val_14)s, 6, %(hogql_val_15)s)), less(toTimeZone(events.timestamp, %(hogql_val_16)s), parseDateTime64BestEffort(%(hogql_val_17)s, 6, %(hogql_val_18)s))), and(greater(toTimeZone(events.timestamp, %(hogql_val_19)s), toDateTime(%(hogql_val_20)s, %(hogql_val_21)s)), less(toTimeZone(events.timestamp, %(hogql_val_22)s), toDateTime64(%(hogql_val_23)s, 6, %(hogql_val_24)s))))))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, %(hogql_val_12)s), isNotNull(events__fingerprint_issue_state.issue_id), or(and(greater(events.timestamp, parseDateTime64BestEffort(%(hogql_val_13)s, 6, %(hogql_val_14)s)), less(events.timestamp, parseDateTime64BestEffort(%(hogql_val_15)s, 6, %(hogql_val_16)s))), and(greater(events.timestamp, toDateTime(%(hogql_val_17)s, %(hogql_val_18)s)), less(events.timestamp, toDateTime64(%(hogql_val_19)s, 6, %(hogql_val_20)s))))))
GROUP BY events__fingerprint_issue_state.issue_id
ORDER BY occurrences DESC
LIMIT 51
diff --git a/posthog/hogql/transforms/property_types.py b/posthog/hogql/transforms/property_types.py
index c733cbbc5714..a19595ab9af6 100644
--- a/posthog/hogql/transforms/property_types.py
+++ b/posthog/hogql/transforms/property_types.py
@@ -137,6 +137,12 @@ class ToTimeZoneParts:
swapped: bool
+@frozen
+class ComparisonOperands:
+ left: ast.Expr
+ right: ast.Expr
+
+
class PropertySwapper(CloningVisitor):
_RANGE_OPS: set[str] = {
ast.CompareOperationOp.Gt,
@@ -144,6 +150,10 @@ class PropertySwapper(CloningVisitor):
ast.CompareOperationOp.Lt,
ast.CompareOperationOp.LtEq,
}
+ _RANGE_FUNCTIONS: set[str] = {"greater", "greaterOrEquals", "less", "lessOrEquals"}
+
+ # A comparison under these calls still filters the rows of the enclosing WHERE, so pruning still applies to it.
+ _BOOLEAN_CONNECTIVES: set[str] = {"and", "or", "not"}
# ClickHouse string-parsing conversions (toFloat64OrZero, toInt64OrZero,
# toFloat64OrDefault, toInt64OrDefault) require a String first argument and raise
@@ -187,7 +197,10 @@ class PropertySwapper(CloningVisitor):
# The CloningVisitor.visit_select_query visits fields in a fixed order.
# We replicate that here, wrapping only where/prewhere with our flag.
saved_where_depth = self._inside_where_depth
+ saved_call_depth = self._inside_call_depth
self._inside_where_depth = 0 # each SelectQuery gets its own scope
+ # A call around the subquery, as in countIf(x IN (SELECT ...)), does not wrap the subquery's own WHERE.
+ self._inside_call_depth = 0
# Visit everything except where/prewhere normally (depth=0, no stripping)
ctes = {key: self.visit(expr) for key, expr in node.ctes.items()} if node.ctes else None
@@ -208,6 +221,7 @@ class PropertySwapper(CloningVisitor):
interpolate = [self.visit(expr) for expr in node.interpolate] if node.interpolate is not None else None
self._inside_where_depth = saved_where_depth # restore parent scope
+ self._inside_call_depth = saved_call_depth
return ast.SelectQuery(
start=None if self.clear_locations else node.start,
@@ -244,19 +258,27 @@ class PropertySwapper(CloningVisitor):
if rewritten is not None:
return rewritten
+ can_move_timezone = node.name in self._RANGE_FUNCTIONS and len(node.args) == 2 and self._can_move_timezone()
+
# Track whether the immediate enclosing call parses its argument as a
# string. Re-evaluated per call, so nested non-parsing calls (e.g.
# toFloatOrZero(toString(prop))) correctly reset the flag.
saved_suppress = self._suppress_numeric_conversion
self._suppress_numeric_conversion = node.name in self._STRING_INPUT_CONVERSIONS
- self._inside_call_depth += 1
+ call_depth_step = 0 if node.name in self._BOOLEAN_CONNECTIVES else 1
+ self._inside_call_depth += call_depth_step
try:
result = super().visit_call(node)
finally:
- self._inside_call_depth -= 1
+ self._inside_call_depth -= call_depth_step
self._suppress_numeric_conversion = saved_suppress
+ if can_move_timezone and isinstance(result, ast.Call):
+ moved = self._move_timezone_to_other_side(result.args[0], result.args[1])
+ if moved is not None:
+ result.args = [moved.left, moved.right]
+
return self._maybe_extract_exception_string_array(result)
def _maybe_extract_exception_string_array(self, node: ast.Expr) -> ast.Expr:
@@ -531,18 +553,21 @@ class PropertySwapper(CloningVisitor):
def visit_compare_operation(self, node: ast.CompareOperation):
result = super().visit_compare_operation(node)
- if (
- not self.setTimeZones
- or result.op not in self._RANGE_OPS
- or self._inside_call_depth > 0
- or self._inside_where_depth == 0
- ):
+ if result.op not in self._RANGE_OPS or not self._can_move_timezone():
return result
- return self._move_timezone_from_field_to_constant(result) or result
+ moved = self._move_timezone_to_other_side(result.left, result.right)
+ if moved is None:
+ return result
+ return ast.CompareOperation(left=moved.left, right=moved.right, op=result.op)
+
+ def _can_move_timezone(self) -> bool:
+ """Only WHERE and PREWHERE gain from pruning. A comparison inside a call other than and(), or() or not()
+ does not filter the rows of the scan, as in if(timestamp >= ..., 1, 0), so it keeps its toTimeZone()."""
+ return self.setTimeZones and self._inside_where_depth > 0 and self._inside_call_depth == 0
- def _move_timezone_from_field_to_constant(self, node: ast.CompareOperation) -> ast.CompareOperation | None:
- """Move toTimeZone() from the field side to the constant side of a range comparison.
+ def _move_timezone_to_other_side(self, left: ast.Expr, right: ast.Expr) -> ComparisonOperands | None:
+ """Move toTimeZone() from the field side to the other side of a range comparison.
ClickHouse DateTime values are epoch seconds internally, and toTimeZone()
only changes display metadata — not the underlying value. So for range
@@ -556,25 +581,24 @@ class PropertySwapper(CloningVisitor):
This lets the query planner use the partition key (toYYYYMM(timestamp))
and primary key (toDate(timestamp)) for pruning, which it can't do when
- the field is wrapped in a function call. The timezone on the constant
+ the field is wrapped in a function call. It also skips evaluating toTimeZone()
+ per granule in the timestamp skip index. The timezone on the other side
ensures ClickHouse interprets it in the correct timezone.
- We only do this for top-level range comparisons (not inside function
- calls like if(), coalesce()) via the _inside_call_depth guard.
+ Returns the new operands, or None if neither side is toTimeZone(field, tz).
"""
- parts = self._extract_toTimeZone_parts(node)
+ parts = self._extract_toTimeZone_parts(left, right)
if parts is None:
return None
- tz_constant = self._anchor_to_timezone(parts.other_side, parts.timezone)
+ anchored = self._anchor_to_timezone(parts.other_side, parts.timezone)
if parts.swapped:
- return ast.CompareOperation(left=tz_constant, right=parts.bare_field, op=node.op)
- else:
- return ast.CompareOperation(left=parts.bare_field, right=tz_constant, op=node.op)
+ return ComparisonOperands(left=anchored, right=parts.bare_field)
+ return ComparisonOperands(left=parts.bare_field, right=anchored)
@staticmethod
- def _extract_toTimeZone_parts(node: ast.CompareOperation) -> ToTimeZoneParts | None:
+ def _extract_toTimeZone_parts(left: ast.Expr, right: ast.Expr) -> ToTimeZoneParts | None:
"""Extract the bare field, timezone, other side and side from a comparison
where one side is toTimeZone(field, tz).
@@ -582,11 +606,12 @@ class PropertySwapper(CloningVisitor):
swapped=True means the toTimeZone was on the right side.
"""
for left_is_tz in (True, False):
- tz_side = node.left if left_is_tz else node.right
- other_side = node.right if left_is_tz else node.left
+ tz_side = left if left_is_tz else right
+ other_side = right if left_is_tz else left
inner = tz_side
- if isinstance(inner, ast.Alias):
+ # A subquery cloned and resolved again, as in the sessions id pushdown, nests one Alias per resolution.
+ while isinstance(inner, ast.Alias):
inner = inner.expr
if isinstance(inner, ast.Call) and inner.name == "toTimeZone" and len(inner.args) == 2:
tz_arg = inner.args[1]
diff --git a/posthog/hogql/transforms/test/__snapshots__/test_preaggregated_table_transformation.ambr b/posthog/hogql/transforms/test/__snapshots__/test_preaggregated_table_transformation.ambr
index c42f87538c2e..cc8fd63902d4 100644
--- a/posthog/hogql/transforms/test/__snapshots__/test_preaggregated_table_transformation.ambr
+++ b/posthog/hogql/transforms/test/__snapshots__/test_preaggregated_table_transformation.ambr
@@ -503,7 +503,7 @@
SELECT sumMerge(e.pageviews_count_state) AS total,
toStartOfDay(toTimeZone(e.period_bucket, 'UTC')) AS day_start
FROM web_pre_aggregated_stats AS e
- WHERE and(equals(e.team_id, 99999), greaterOrEquals(toTimeZone(e.period_bucket, 'UTC'), toStartOfInterval(assumeNotNull(toDateTime('2024-11-22 00:00:00', 'UTC')), toIntervalDay(1))), lessOrEquals(toTimeZone(e.period_bucket, 'UTC'), assumeNotNull(toDateTime('2024-11-26 23:59:59', 'UTC'))))
+ WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.period_bucket, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2024-11-22 00:00:00', 'UTC')), toIntervalDay(1)), 9, 'UTC')), lessOrEquals(e.period_bucket, assumeNotNull(toDateTime('2024-11-26 23:59:59', 'UTC'))))
GROUP BY day_start
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -531,7 +531,7 @@
(SELECT uniqMerge(e.persons_uniq_state) AS total,
toStartOfDay(toTimeZone(e.period_bucket, 'UTC')) AS day_start
FROM web_pre_aggregated_stats AS e
- WHERE and(equals(e.team_id, 99999), greaterOrEquals(toTimeZone(e.period_bucket, 'UTC'), toStartOfInterval(assumeNotNull(toDateTime('2024-11-22 00:00:00', 'UTC')), toIntervalDay(1))), lessOrEquals(toTimeZone(e.period_bucket, 'UTC'), assumeNotNull(toDateTime('2024-11-26 23:59:59', 'UTC'))))
+ WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.period_bucket, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2024-11-22 00:00:00', 'UTC')), toIntervalDay(1)), 9, 'UTC')), lessOrEquals(e.period_bucket, assumeNotNull(toDateTime('2024-11-26 23:59:59', 'UTC'))))
GROUP BY day_start)
GROUP BY day_start
ORDER BY day_start ASC)
@@ -562,7 +562,7 @@
(SELECT sumMerge(e.pageviews_count_state) AS total,
toStartOfDay(toTimeZone(e.period_bucket, 'UTC')) AS day_start
FROM web_pre_aggregated_stats AS e
- WHERE and(equals(e.team_id, 99999), greaterOrEquals(toTimeZone(e.period_bucket, 'UTC'), toStartOfInterval(assumeNotNull(toDateTime('2024-11-22 00:00:00', 'UTC')), toIntervalDay(1))), lessOrEquals(toTimeZone(e.period_bucket, 'UTC'), assumeNotNull(toDateTime('2024-11-26 23:59:59', 'UTC'))))
+ WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.period_bucket, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2024-11-22 00:00:00', 'UTC')), toIntervalDay(1)), 9, 'UTC')), lessOrEquals(e.period_bucket, assumeNotNull(toDateTime('2024-11-26 23:59:59', 'UTC'))))
GROUP BY day_start)
GROUP BY day_start
ORDER BY day_start ASC)
diff --git a/posthog/hogql/transforms/test/__snapshots__/test_state_aggregations.ambr b/posthog/hogql/transforms/test/__snapshots__/test_state_aggregations.ambr
index 7bd98342472b..8a759a7e7bac 100644
--- a/posthog/hogql/transforms/test/__snapshots__/test_state_aggregations.ambr
+++ b/posthog/hogql/transforms/test/__snapshots__/test_state_aggregations.ambr
@@ -151,13 +151,13 @@
FROM (
SELECT countState() AS total_pageviews
FROM events
- WHERE and(equals(events.team_id, 420), less(events.timestamp, toDateTime64(minus(now64(6, %(hogql_val_0)s), toIntervalDay(1)), 6, %(hogql_val_1)s))))
+ WHERE and(equals(events.team_id, 420), less(events.timestamp, toDateTime64(minus(now64(6, %(hogql_val_0)s), toIntervalDay(1)), 9, %(hogql_val_1)s))))
LIMIT 50000 UNION ALL
SELECT countMerge(total_pageviews) AS total_pageviews
FROM (
SELECT countState() AS total_pageviews
FROM events
- WHERE and(equals(events.team_id, 420), greaterOrEquals(events.timestamp, toDateTime64(minus(now64(6, %(hogql_val_2)s), toIntervalDay(1)), 6, %(hogql_val_3)s))))
+ WHERE and(equals(events.team_id, 420), greaterOrEquals(events.timestamp, toDateTime64(minus(now64(6, %(hogql_val_2)s), toIntervalDay(1)), 9, %(hogql_val_3)s))))
LIMIT 50000
'''
# ---
@@ -480,13 +480,13 @@
FROM (
SELECT countState() AS total_pageviews
FROM events
- WHERE and(equals(events.team_id, 420), less(events.timestamp, toDateTime64(minus(now64(6, %(hogql_val_0)s), toIntervalDay(1)), 6, %(hogql_val_1)s))))
+ WHERE and(equals(events.team_id, 420), less(events.timestamp, toDateTime64(minus(now64(6, %(hogql_val_0)s), toIntervalDay(1)), 9, %(hogql_val_1)s))))
LIMIT 50000 UNION ALL
SELECT countMerge(total_pageviews) AS total_pageviews
FROM (
SELECT countState() AS total_pageviews
FROM events
- WHERE and(equals(events.team_id, 420), greaterOrEquals(events.timestamp, toDateTime64(minus(now64(6, %(hogql_val_2)s), toIntervalDay(1)), 6, %(hogql_val_3)s))))
+ WHERE and(equals(events.team_id, 420), greaterOrEquals(events.timestamp, toDateTime64(minus(now64(6, %(hogql_val_2)s), toIntervalDay(1)), 9, %(hogql_val_3)s))))
LIMIT 50000
'''
# ---
diff --git a/posthog/hogql/transforms/test/test_property_types.py b/posthog/hogql/transforms/test/test_property_types.py
index 6dcbabf447c7..c276e02da3b3 100644
--- a/posthog/hogql/transforms/test/test_property_types.py
+++ b/posthog/hogql/transforms/test/test_property_types.py
@@ -1772,6 +1772,8 @@ class TestTimezoneIndexPruning(ClickhouseTestMixin, BaseTest):
@parameterized.expand(
[
("infix_and", "timestamp >= '2024-03-01' AND timestamp < '2024-04-01'"),
+ ("and_call", "and(timestamp >= '2024-03-01', timestamp < '2024-04-01')"),
+ ("comparison_calls", "greaterOrEquals(timestamp, '2024-03-01') AND less(timestamp, '2024-04-01')"),
("date_bounds", "timestamp >= toDate('2024-03-01') AND timestamp < toDate('2024-04-01')"),
]
)
@@ -1789,13 +1791,23 @@ class TestTimezoneIndexPruning(ClickhouseTestMixin, BaseTest):
assert primary_key is not None
self._assert_primary_key_uses_timestamp_range(primary_key)
- def test_toTimeZone_stripped_from_where_but_kept_in_select(self):
- """toTimeZone should be stripped from top-level WHERE range comparisons
- but preserved in SELECT expressions and inside function calls."""
- sql, _ = self._compile_hogql(
- "SELECT timestamp FROM events WHERE timestamp >= '2024-03-01' AND timestamp < '2024-04-01'",
- timezone="America/New_York",
- )
+ @parameterized.expand(
+ [
+ ("infix_and", "timestamp >= '2024-03-01' AND timestamp < '2024-04-01'"),
+ ("and_call", "and(timestamp >= '2024-03-01', timestamp < '2024-04-01')"),
+ ("or_and_call_with_constant", "or(and(timestamp >= '2024-03-01', timestamp < '2024-04-01'), 0)"),
+ ("not_call", "not(timestamp < '2024-03-01') AND timestamp < '2024-04-01'"),
+ ("comparison_calls", "greaterOrEquals(timestamp, '2024-03-01') AND less(timestamp, '2024-04-01')"),
+ (
+ "comparison_calls_in_and_call",
+ "and(greaterOrEquals(timestamp, '2024-03-01'), less(timestamp, '2024-04-01'))",
+ ),
+ ]
+ )
+ def test_toTimeZone_stripped_from_where_but_kept_in_select(self, _name, where):
+ """toTimeZone should be stripped from WHERE range comparisons reached through boolean connectives
+ but preserved in SELECT expressions and inside other function calls."""
+ sql, _ = self._compile_hogql(f"SELECT timestamp FROM events WHERE {where}", timezone="America/New_York")
where_clause = sql.split("WHERE")[1]
select_clause = sql.split("WHERE")[0]
assert "toTimeZone" not in where_clause, f"Expected toTimeZone stripped from WHERE, got:\n{where_clause}"
@@ -1852,6 +1864,15 @@ class TestTimezoneIndexPruning(ClickhouseTestMixin, BaseTest):
assert "toTimeZone" not in where_clause, f"Expected toTimeZone stripped from WHERE, got:\n{where_clause}"
assert "toTimeZone" in select_clause, f"Expected toTimeZone preserved in SELECT if(), got:\n{select_clause}"
+ # A subquery nested in a call still strips its own WHERE
+ sql, _ = self._compile_hogql(
+ "SELECT countIf(distinct_id IN (SELECT distinct_id FROM events WHERE timestamp >= '2024-03-01')) FROM events",
+ timezone="America/New_York",
+ )
+ assert re.search(r"greaterOrEquals\(events\.timestamp, toDateTime64", sql), (
+ f"Expected bare events.timestamp in the WHERE of the subquery inside countIf(), got:\n{sql}"
+ )
+
def test_subquery_in_where_does_not_inherit_stripping(self):
"""A subquery's SELECT inside a WHERE should NOT inherit stripping from the outer WHERE."""
sql, _ = self._compile_hogql(
@@ -1910,6 +1931,11 @@ class TestTimezoneIndexPruning(ClickhouseTestMixin, BaseTest):
"start_of_month",
"timestamp >= toStartOfMonth(toDateTime('2024-03-15 00:00:00')) AND timestamp < toDate('2024-03-02')",
),
+ (
+ "comparison_calls",
+ "greaterOrEquals(timestamp, toDate('2024-03-01')) AND less(timestamp, toDate('2024-03-02'))",
+ ),
+ ("and_call", "and(timestamp >= toDate('2024-03-01'), timestamp < toDate('2024-03-02'))"),
]
)
def test_date_bounds_use_project_timezone(self, _name, where):
diff --git a/posthog/hogql_queries/ai/test/__snapshots__/test_event_taxonomy_query_runner.ambr b/posthog/hogql_queries/ai/test/__snapshots__/test_event_taxonomy_query_runner.ambr
index f5261069f3a7..76a993aecaa0 100644
--- a/posthog/hogql_queries/ai/test/__snapshots__/test_event_taxonomy_query_runner.ambr
+++ b/posthog/hogql_queries/ai/test/__snapshots__/test_event_taxonomy_query_runner.ambr
@@ -14,7 +14,7 @@
(SELECT JSONExtractKeysAndValues(events.properties, 'String') AS kv,
toTimeZone(events.timestamp, 'UTC') AS timestamp
FROM events
- WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64(minus(now64(6, 'UTC'), toIntervalDay(30)), 6, 'UTC')), equals(events.event, 'event1'))
+ WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64(minus(now64(6, 'UTC'), toIntervalDay(30)), 9, 'UTC')), equals(events.event, 'event1'))
ORDER BY toTimeZone(events.timestamp, 'UTC') DESC
LIMIT 100) ARRAY
JOIN (kv).1 AS key,
@@ -55,7 +55,7 @@
(SELECT [tuple('zero_duration_recording_count_in_period', JSONExtractString(events.properties, 'zero_duration_recording_count_in_period'))] AS kv,
toTimeZone(events.timestamp, 'UTC') AS timestamp
FROM events
- WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64(minus(now64(6, 'UTC'), toIntervalDay(30)), 6, 'UTC')), equals(events.event, 'organization usage report'), notEquals(JSONExtractString(events.properties, 'zero_duration_recording_count_in_period'), ''))) ARRAY
+ WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64(minus(now64(6, 'UTC'), toIntervalDay(30)), 9, 'UTC')), equals(events.event, 'organization usage report'), notEquals(JSONExtractString(events.properties, 'zero_duration_recording_count_in_period'), ''))) ARRAY
JOIN (kv).1 AS key,
(kv).2 AS value
WHERE and(isNotNull(value), ifNull(notEquals(value, ''), 1))
@@ -94,7 +94,7 @@
(SELECT JSONExtractKeysAndValues(events.properties, 'String') AS kv,
toTimeZone(events.timestamp, 'UTC') AS timestamp
FROM events
- WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64(minus(now64(6, 'UTC'), toIntervalDay(30)), 6, 'UTC')), equals(events.event, '$pageview'))
+ WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64(minus(now64(6, 'UTC'), toIntervalDay(30)), 9, 'UTC')), equals(events.event, '$pageview'))
ORDER BY toTimeZone(events.timestamp, 'UTC') DESC
LIMIT 100) ARRAY
JOIN (kv).1 AS key,
diff --git a/posthog/hogql_queries/ai/test/__snapshots__/test_suggested_questions_query_runner.ambr b/posthog/hogql_queries/ai/test/__snapshots__/test_suggested_questions_query_runner.ambr
index 54096e39a5c0..f077726909fb 100644
--- a/posthog/hogql_queries/ai/test/__snapshots__/test_suggested_questions_query_runner.ambr
+++ b/posthog/hogql_queries/ai/test/__snapshots__/test_suggested_questions_query_runner.ambr
@@ -4,7 +4,7 @@
SELECT events.event AS event,
count() AS count
FROM events
- WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64(minus(now64(6, 'UTC'), toIntervalDay(30)), 6, 'UTC')), notIn(events.event, ['$pageleave', '$autocapture', '$$heatmap', '$copy_autocapture', '$set', '$opt_in', '$feature_flag_called', '$experiment_exposure', '$feature_view', '$feature_interaction', '$element_viewed', '$capture_metrics', '$create_alias', '$merge_dangerously', '$groupidentify', 'mcp_tool_call', 'mcp_tools_list', 'mcp_initialize', 'mcp_resources_list', 'mcp_resource_read', 'mcp_prompts_list', 'mcp_prompt_get', 'mcp_custom', 'posthog_identify', 'mcp init', 'mcp_mcpcat:identify', 'mcp_posthog:identify', 'mcp_tool_called', 'mcp tool call', 'mcp tool response', '$snapshot']))
+ WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64(minus(now64(6, 'UTC'), toIntervalDay(30)), 9, 'UTC')), notIn(events.event, ['$pageleave', '$autocapture', '$$heatmap', '$copy_autocapture', '$set', '$opt_in', '$feature_flag_called', '$experiment_exposure', '$feature_view', '$feature_interaction', '$element_viewed', '$capture_metrics', '$create_alias', '$merge_dangerously', '$groupidentify', 'mcp_tool_call', 'mcp_tools_list', 'mcp_initialize', 'mcp_resources_list', 'mcp_resource_read', 'mcp_prompts_list', 'mcp_prompt_get', 'mcp_custom', 'posthog_identify', 'mcp init', 'mcp_mcpcat:identify', 'mcp_posthog:identify', 'mcp_tool_called', 'mcp tool call', 'mcp tool response', '$snapshot']))
GROUP BY events.event
ORDER BY count DESC, events.event ASC
LIMIT 501
diff --git a/posthog/hogql_queries/ai/test/__snapshots__/test_team_taxonomy_query_runner.ambr b/posthog/hogql_queries/ai/test/__snapshots__/test_team_taxonomy_query_runner.ambr
index cd5d1283a34f..cefd03a1ea24 100644
--- a/posthog/hogql_queries/ai/test/__snapshots__/test_team_taxonomy_query_runner.ambr
+++ b/posthog/hogql_queries/ai/test/__snapshots__/test_team_taxonomy_query_runner.ambr
@@ -4,7 +4,7 @@
SELECT events.event AS event,
count() AS count
FROM events
- WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64(minus(now64(6, 'UTC'), toIntervalDay(30)), 6, 'UTC')), notIn(events.event, ['$pageleave', '$autocapture', '$$heatmap', '$copy_autocapture', '$set', '$opt_in', '$feature_flag_called', '$experiment_exposure', '$feature_view', '$feature_interaction', '$element_viewed', '$capture_metrics', '$create_alias', '$merge_dangerously', '$groupidentify', 'mcp_tool_call', 'mcp_tools_list', 'mcp_initialize', 'mcp_resources_list', 'mcp_resource_read', 'mcp_prompts_list', 'mcp_prompt_get', 'mcp_custom', 'posthog_identify', 'mcp init', 'mcp_mcpcat:identify', 'mcp_posthog:identify', 'mcp_tool_called', 'mcp tool call', 'mcp tool response', '$snapshot']))
+ WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64(minus(now64(6, 'UTC'), toIntervalDay(30)), 9, 'UTC')), notIn(events.event, ['$pageleave', '$autocapture', '$$heatmap', '$copy_autocapture', '$set', '$opt_in', '$feature_flag_called', '$experiment_exposure', '$feature_view', '$feature_interaction', '$element_viewed', '$capture_metrics', '$create_alias', '$merge_dangerously', '$groupidentify', 'mcp_tool_call', 'mcp_tools_list', 'mcp_initialize', 'mcp_resources_list', 'mcp_resource_read', 'mcp_prompts_list', 'mcp_prompt_get', 'mcp_custom', 'posthog_identify', 'mcp init', 'mcp_mcpcat:identify', 'mcp_posthog:identify', 'mcp_tool_called', 'mcp tool call', 'mcp tool response', '$snapshot']))
GROUP BY events.event
ORDER BY count DESC, events.event ASC
LIMIT 501
diff --git a/posthog/models/web_preaggregated/__snapshots__/test_web_pre_aggregated_timezones.ambr b/posthog/models/web_preaggregated/__snapshots__/test_web_pre_aggregated_timezones.ambr
index 1a0eae289a2d..c3850b445806 100644
--- a/posthog/models/web_preaggregated/__snapshots__/test_web_pre_aggregated_timezones.ambr
+++ b/posthog/models/web_preaggregated/__snapshots__/test_web_pre_aggregated_timezones.ambr
@@ -44,7 +44,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'Asia/Kolkata'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Asia/Kolkata'))), lessOrEquals(toTimeZone(events.timestamp, 'Asia/Kolkata'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Asia/Kolkata')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Asia/Kolkata'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Asia/Kolkata')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -111,7 +111,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -178,7 +178,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'America/Los_Angeles'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'America/Los_Angeles'))), lessOrEquals(toTimeZone(events.timestamp, 'America/Los_Angeles'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'America/Los_Angeles')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'America/Los_Angeles'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'America/Los_Angeles')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -245,7 +245,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'Asia/Tokyo'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Asia/Tokyo'))), lessOrEquals(toTimeZone(events.timestamp, 'Asia/Tokyo'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Asia/Tokyo')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Asia/Tokyo'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Asia/Tokyo')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -312,7 +312,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'America/Los_Angeles'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'America/Los_Angeles'))), lessOrEquals(toTimeZone(events.timestamp, 'America/Los_Angeles'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'America/Los_Angeles')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'America/Los_Angeles'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'America/Los_Angeles')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -379,7 +379,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'America/New_York'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'America/New_York'))), lessOrEquals(toTimeZone(events.timestamp, 'America/New_York'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'America/New_York')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'America/New_York'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'America/New_York')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -446,7 +446,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'America/Sao_Paulo'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'America/Sao_Paulo'))), lessOrEquals(toTimeZone(events.timestamp, 'America/Sao_Paulo'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'America/Sao_Paulo')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'America/Sao_Paulo'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'America/Sao_Paulo')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -513,7 +513,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -580,7 +580,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'Europe/Berlin'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Europe/Berlin'))), lessOrEquals(toTimeZone(events.timestamp, 'Europe/Berlin'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Europe/Berlin')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Europe/Berlin'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Europe/Berlin')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -647,7 +647,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'Africa/Cairo'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Africa/Cairo'))), lessOrEquals(toTimeZone(events.timestamp, 'Africa/Cairo'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Africa/Cairo')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Africa/Cairo'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Africa/Cairo')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -714,7 +714,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'Europe/Moscow'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Europe/Moscow'))), lessOrEquals(toTimeZone(events.timestamp, 'Europe/Moscow'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Europe/Moscow')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Europe/Moscow'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Europe/Moscow')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -781,7 +781,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'Asia/Karachi'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Asia/Karachi'))), lessOrEquals(toTimeZone(events.timestamp, 'Asia/Karachi'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Asia/Karachi')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Asia/Karachi'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Asia/Karachi')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -848,7 +848,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'Asia/Tokyo'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Asia/Tokyo'))), lessOrEquals(toTimeZone(events.timestamp, 'Asia/Tokyo'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Asia/Tokyo')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Asia/Tokyo'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Asia/Tokyo')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -915,7 +915,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'Australia/Sydney'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Australia/Sydney'))), lessOrEquals(toTimeZone(events.timestamp, 'Australia/Sydney'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Australia/Sydney')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Australia/Sydney'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Australia/Sydney')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -982,7 +982,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'Pacific/Auckland'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Pacific/Auckland'))), lessOrEquals(toTimeZone(events.timestamp, 'Pacific/Auckland'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Pacific/Auckland')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Pacific/Auckland'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Pacific/Auckland')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
diff --git a/posthog/models/web_preaggregated/__snapshots__/test_web_pre_aggregated_timezones.new_events_schema.ambr b/posthog/models/web_preaggregated/__snapshots__/test_web_pre_aggregated_timezones.new_events_schema.ambr
index f137cc227504..be7ed55367f2 100644
--- a/posthog/models/web_preaggregated/__snapshots__/test_web_pre_aggregated_timezones.new_events_schema.ambr
+++ b/posthog/models/web_preaggregated/__snapshots__/test_web_pre_aggregated_timezones.new_events_schema.ambr
@@ -19,7 +19,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'Asia/Kolkata'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Asia/Kolkata'))), lessOrEquals(toTimeZone(events.timestamp, 'Asia/Kolkata'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Asia/Kolkata')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Asia/Kolkata'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Asia/Kolkata')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -61,7 +61,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'America/Los_Angeles'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'America/Los_Angeles'))), lessOrEquals(toTimeZone(events.timestamp, 'America/Los_Angeles'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'America/Los_Angeles')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'America/Los_Angeles'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'America/Los_Angeles')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -103,7 +103,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'Asia/Tokyo'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Asia/Tokyo'))), lessOrEquals(toTimeZone(events.timestamp, 'Asia/Tokyo'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Asia/Tokyo')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Asia/Tokyo'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Asia/Tokyo')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -145,7 +145,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -187,7 +187,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'America/Los_Angeles'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'America/Los_Angeles'))), lessOrEquals(toTimeZone(events.timestamp, 'America/Los_Angeles'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'America/Los_Angeles')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'America/Los_Angeles'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'America/Los_Angeles')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -229,7 +229,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'America/New_York'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'America/New_York'))), lessOrEquals(toTimeZone(events.timestamp, 'America/New_York'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'America/New_York')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'America/New_York'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'America/New_York')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -271,7 +271,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'America/Sao_Paulo'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'America/Sao_Paulo'))), lessOrEquals(toTimeZone(events.timestamp, 'America/Sao_Paulo'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'America/Sao_Paulo')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'America/Sao_Paulo'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'America/Sao_Paulo')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -313,7 +313,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -355,7 +355,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'Europe/Berlin'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Europe/Berlin'))), lessOrEquals(toTimeZone(events.timestamp, 'Europe/Berlin'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Europe/Berlin')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Europe/Berlin'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Europe/Berlin')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -397,7 +397,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'Africa/Cairo'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Africa/Cairo'))), lessOrEquals(toTimeZone(events.timestamp, 'Africa/Cairo'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Africa/Cairo')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Africa/Cairo'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Africa/Cairo')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -439,7 +439,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'Europe/Moscow'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Europe/Moscow'))), lessOrEquals(toTimeZone(events.timestamp, 'Europe/Moscow'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Europe/Moscow')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Europe/Moscow'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Europe/Moscow')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -481,7 +481,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'Asia/Karachi'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Asia/Karachi'))), lessOrEquals(toTimeZone(events.timestamp, 'Asia/Karachi'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Asia/Karachi')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Asia/Karachi'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Asia/Karachi')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -523,7 +523,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'Asia/Tokyo'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Asia/Tokyo'))), lessOrEquals(toTimeZone(events.timestamp, 'Asia/Tokyo'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Asia/Tokyo')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Asia/Tokyo'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Asia/Tokyo')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -565,7 +565,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'Australia/Sydney'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Australia/Sydney'))), lessOrEquals(toTimeZone(events.timestamp, 'Australia/Sydney'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Australia/Sydney')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Australia/Sydney'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Australia/Sydney')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -607,7 +607,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'Pacific/Auckland'), assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Pacific/Auckland'))), lessOrEquals(toTimeZone(events.timestamp, 'Pacific/Auckland'), assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Pacific/Auckland')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-15 00:00:00', 'Pacific/Auckland'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-16 23:59:59', 'Pacific/Auckland')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
diff --git a/products/product_analytics/backend/hogql_queries/stickiness/test/__snapshots__/test_stickiness_query_runner.ambr b/products/product_analytics/backend/hogql_queries/stickiness/test/__snapshots__/test_stickiness_query_runner.ambr
index 3e157c76c311..687b88bf1b32 100644
--- a/products/product_analytics/backend/hogql_queries/stickiness/test/__snapshots__/test_stickiness_query_runner.ambr
+++ b/products/product_analytics/backend/hogql_queries/stickiness/test/__snapshots__/test_stickiness_query_runner.ambr
@@ -291,7 +291,7 @@
(SELECT e.id AS aggregation_target,
toStartOfInterval(toTimeZone(e.created, 'UTC'), toIntervalDay(1)) AS start_of_interval
FROM s3('http://host.docker.internal:19000/posthog/test_storage_bucket-posthog.hogql.datawarehouse.stickinessquery/posthog_test_test_table_stickiness/*.csv', 'object_storage_root_user', 'object_storage_root_password', 'CSVWithNames', '`id` String, `prop_1` String, `prop_2` String, `created` DateTime64(3, \'UTC\')') AS e
- WHERE and(greaterOrEquals(toTimeZone(e.created, 'UTC'), toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1))), lessOrEquals(toTimeZone(e.created, 'UTC'), assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))))
+ WHERE and(greaterOrEquals(e.created, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1)), 9, 'UTC')), lessOrEquals(e.created, assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))))
GROUP BY aggregation_target,
start_of_interval
HAVING greater(count(), 0))
diff --git a/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_boxplot_trends_query_runner.ambr b/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_boxplot_trends_query_runner.ambr
index df486166e62a..9de0e7f77321 100644
--- a/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_boxplot_trends_query_runner.ambr
+++ b/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_boxplot_trends_query_runner.ambr
@@ -803,7 +803,7 @@
max(accurateCastOrNull(e.revenue, 'Float64')) AS max_val,
avg(accurateCastOrNull(e.revenue, 'Float64')) AS mean_val
FROM s3('http://host.docker.internal:19000/posthog/test_storage_bucket-posthog.hogql.datawarehouse.boxplot/posthog_test_boxplot_table/*.csv', 'object_storage_root_user', 'object_storage_root_password', 'CSVWithNames', '`id` String, `created` DateTime64(3, \'UTC\'), `revenue` Float64') AS e
- WHERE and(greaterOrEquals(toTimeZone(e.created, 'UTC'), toStartOfInterval(assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC')), toIntervalDay(1))), lessOrEquals(toTimeZone(e.created, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC'))))
+ WHERE and(greaterOrEquals(e.created, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC')), toIntervalDay(1)), 9, 'UTC')), lessOrEquals(e.created, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC'))))
GROUP BY day_start
ORDER BY day_start ASC
LIMIT 100 SETTINGS format_csv_allow_double_quotes=1,
diff --git a/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_trends_data_warehouse_query.ambr b/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_trends_data_warehouse_query.ambr
index 8dff4d188cb1..9abfd10258d2 100644
--- a/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_trends_data_warehouse_query.ambr
+++ b/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_trends_data_warehouse_query.ambr
@@ -19,7 +19,7 @@
toStartOfDay(toTimeZone(e.created, 'UTC')) AS day_start,
ifNull(nullIf(leftUTF8(toString(e.prop_1), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM s3('http://host.docker.internal:19000/posthog/test_storage_bucket-posthog.hogql.datawarehouse.trendquery/posthog_test_test_table_1/*.csv', 'object_storage_root_user', 'object_storage_root_password', 'CSVWithNames', '`id` String, `prop_1` String, `prop_2` String, `created` DateTime64(3, \'UTC\')') AS e
- WHERE and(greaterOrEquals(toTimeZone(e.created, 'UTC'), toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1))), lessOrEquals(toTimeZone(e.created, 'UTC'), assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))))
+ WHERE and(greaterOrEquals(e.created, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1)), 9, 'UTC')), lessOrEquals(e.created, assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))))
GROUP BY day_start,
breakdown_value)
GROUP BY day_start,
@@ -94,7 +94,7 @@
posthog_test_test_table_1.prop_1 AS prop_2,
1 AS boolfield
FROM s3('http://host.docker.internal:19000/posthog/test_storage_bucket-posthog.hogql.datawarehouse.trendquery/posthog_test_test_table_1/*.csv', 'object_storage_root_user', 'object_storage_root_password', 'CSVWithNames', '`id` String, `prop_1` String, `prop_2` String, `created` DateTime64(3, \'UTC\')') AS posthog_test_test_table_1) AS e
- WHERE and(greaterOrEquals(toTimeZone(e.created, 'UTC'), toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1))), lessOrEquals(toTimeZone(e.created, 'UTC'), assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))))
+ WHERE and(greaterOrEquals(e.created, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1)), 9, 'UTC')), lessOrEquals(e.created, assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))))
GROUP BY day_start,
breakdown_value)
GROUP BY day_start,
@@ -216,7 +216,7 @@
toStartOfDay(toTimeZone(e.created, 'UTC')) AS day_start,
ifNull(nullIf(leftUTF8(toString(e.prop_1), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM s3('http://host.docker.internal:19000/posthog/test_storage_bucket-posthog.hogql.datawarehouse.trendquery/posthog_test_test_table_1/*.csv', 'object_storage_root_user', 'object_storage_root_password', 'CSVWithNames', '`id` String, `prop_1` String, `prop_2` String, `created` DateTime64(3, \'UTC\')') AS e
- WHERE and(greaterOrEquals(toTimeZone(e.created, 'UTC'), toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1))), lessOrEquals(toTimeZone(e.created, 'UTC'), assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))), equals(e.prop_1, 'a'))
+ WHERE and(greaterOrEquals(e.created, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1)), 9, 'UTC')), lessOrEquals(e.created, assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))), equals(e.prop_1, 'a'))
GROUP BY day_start,
breakdown_value)
GROUP BY day_start,
@@ -255,7 +255,7 @@
(SELECT count() AS total,
toStartOfDay(toTimeZone(e.created, 'UTC')) AS day_start
FROM s3('http://host.docker.internal:19000/posthog/test_storage_bucket-posthog.hogql.datawarehouse.trendquery/posthog_test_test_table_1/*.csv', 'object_storage_root_user', 'object_storage_root_password', 'CSVWithNames', '`id` String, `prop_1` String, `prop_2` String, `created` DateTime64(3, \'UTC\')') AS e
- WHERE and(greaterOrEquals(toTimeZone(e.created, 'UTC'), toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1))), lessOrEquals(toTimeZone(e.created, 'UTC'), assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))))
+ WHERE and(greaterOrEquals(e.created, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1)), 9, 'UTC')), lessOrEquals(e.created, assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))))
GROUP BY day_start)
GROUP BY day_start
ORDER BY day_start ASC)
@@ -306,7 +306,7 @@
(SELECT count() AS total,
toStartOfDay(toTimeZone(e.created, 'UTC')) AS day_start
FROM s3('http://host.docker.internal:19000/posthog/test_storage_bucket-posthog.hogql.datawarehouse.trendquery/posthog_test_test_table_1/*.csv', 'object_storage_root_user', 'object_storage_root_password', 'CSVWithNames', '`id` String, `prop_1` String, `prop_2` String, `created` DateTime64(3, \'UTC\')') AS e
- WHERE and(greaterOrEquals(toTimeZone(e.created, 'UTC'), toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1))), lessOrEquals(toTimeZone(e.created, 'UTC'), assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))))
+ WHERE and(greaterOrEquals(e.created, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1)), 9, 'UTC')), lessOrEquals(e.created, assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))))
GROUP BY day_start)
GROUP BY day_start
ORDER BY day_start ASC)
@@ -338,7 +338,7 @@
(SELECT count() AS total,
toStartOfDay(toTimeZone(e.created, 'UTC')) AS day_start
FROM s3('http://host.docker.internal:19000/posthog/test_storage_bucket-posthog.hogql.datawarehouse.trendquery/posthog_test_test_table_1/*.csv', 'object_storage_root_user', 'object_storage_root_password', 'CSVWithNames', '`id` String, `prop_1` String, `prop_2` String, `created` DateTime64(3, \'UTC\')') AS e
- WHERE and(greaterOrEquals(toTimeZone(e.created, 'UTC'), toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1))), lessOrEquals(toTimeZone(e.created, 'UTC'), assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))), equals(e.prop_1, 'a'))
+ WHERE and(greaterOrEquals(e.created, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1)), 9, 'UTC')), lessOrEquals(e.created, assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))), equals(e.prop_1, 'a'))
GROUP BY day_start)
GROUP BY day_start
ORDER BY day_start ASC)
@@ -409,7 +409,7 @@
(SELECT count() AS total,
toStartOfDay(toTimeZone(e.created, 'UTC')) AS day_start
FROM s3('http://host.docker.internal:19000/posthog/test_storage_bucket-posthog.hogql.datawarehouse.trendquery/posthog_test_test_table_1/*.csv', 'object_storage_root_user', 'object_storage_root_password', 'CSVWithNames', '`id` String, `prop_1` String, `prop_2` String, `created` DateTime64(3, \'UTC\')') AS e
- WHERE and(greaterOrEquals(toTimeZone(e.created, 'UTC'), toStartOfInterval(assumeNotNull(toDateTime('2022-12-01 00:00:00', 'UTC')), toIntervalDay(1))), lessOrEquals(toTimeZone(e.created, 'UTC'), assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))))
+ WHERE and(greaterOrEquals(e.created, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2022-12-01 00:00:00', 'UTC')), toIntervalDay(1)), 9, 'UTC')), lessOrEquals(e.created, assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))))
GROUP BY day_start)
GROUP BY day_start
ORDER BY day_start ASC)
@@ -528,7 +528,7 @@
(SELECT count() AS total,
toStartOfDay(toTimeZone(e.created, 'UTC')) AS day_start
FROM s3('http://host.docker.internal:19000/posthog/test_storage_bucket-posthog.hogql.datawarehouse.trendquery/posthog_test_test_table_1/*.csv', 'object_storage_root_user', 'object_storage_root_password', 'CSVWithNames', '`id` String, `prop_1` String, `prop_2` String, `created` DateTime64(3, \'UTC\')') AS e
- WHERE and(greaterOrEquals(toTimeZone(e.created, 'UTC'), toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1))), lessOrEquals(toTimeZone(e.created, 'UTC'), assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))), equals(e.prop_1, 'a'))
+ WHERE and(greaterOrEquals(e.created, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1)), 9, 'UTC')), lessOrEquals(e.created, assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))), equals(e.prop_1, 'a'))
GROUP BY day_start)
GROUP BY day_start
ORDER BY day_start ASC)
@@ -560,7 +560,7 @@
(SELECT count() AS total,
toStartOfDay(toTimeZone(e.created, 'UTC')) AS day_start
FROM s3('http://host.docker.internal:19000/posthog/test_storage_bucket-posthog.hogql.datawarehouse.trendquery/posthog_test_test_table_1/*.csv', 'object_storage_root_user', 'object_storage_root_password', 'CSVWithNames', '`id` String, `prop_1` String, `prop_2` String, `created` DateTime64(3, \'UTC\')') AS e
- WHERE and(greaterOrEquals(toTimeZone(e.created, 'UTC'), toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1))), lessOrEquals(toTimeZone(e.created, 'UTC'), assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))), and(equals(e.prop_1, 'a'), equals(e.prop_2, 'e'), equals(e.prop_1, 'a')))
+ WHERE and(greaterOrEquals(e.created, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1)), 9, 'UTC')), lessOrEquals(e.created, assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))), and(equals(e.prop_1, 'a'), equals(e.prop_2, 'e'), equals(e.prop_1, 'a')))
GROUP BY day_start)
GROUP BY day_start
ORDER BY day_start ASC)
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_external_clicks_table.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_external_clicks_table.ambr
index a7f26be6d5f8..4e0a20b272f9 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_external_clicks_table.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_external_clicks_table.ambr
@@ -44,7 +44,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$event_type'), ''), 'null'), '^"|"$', ''), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')), cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', ''))), isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')))
- or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -90,7 +90,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$event_type'), ''), 'null'), '^"|"$', ''), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')), cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', ''))), isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')))
- or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -136,7 +136,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$event_type'), ''), 'null'), '^"|"$', ''), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')), cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', ''))), isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')))
- or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -182,7 +182,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$event_type'), ''), 'null'), '^"|"$', ''), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')), cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', ''))), isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')))
- or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -228,7 +228,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$event_type'), ''), 'null'), '^"|"$', ''), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')), cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', ''))), isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')))
- or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), ifNull(notILike(toString(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.person_properties, 'email'), ''), 'null'), '^"|"$', '')), '%@posthog.com%'), 1)))
+ or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), ifNull(notILike(toString(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.person_properties, 'email'), ''), 'null'), '^"|"$', '')), '%@posthog.com%'), 1)))
GROUP BY events.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -274,7 +274,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$event_type'), ''), 'null'), '^"|"$', ''), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')), cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', ''))), isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')))
- or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-11 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-11 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -320,7 +320,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$event_type'), ''), 'null'), '^"|"$', ''), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')), cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', ''))), isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')))
- or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -366,7 +366,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$event_type'), ''), 'null'), '^"|"$', ''), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')), cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', ''))), isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')))
- or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -412,7 +412,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$event_type'), ''), 'null'), '^"|"$', ''), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')), cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', ''))), isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')))
- or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -458,7 +458,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$event_type'), ''), 'null'), '^"|"$', ''), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')), cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', ''))), isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')))
- or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -504,7 +504,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$event_type'), ''), 'null'), '^"|"$', ''), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')), cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', ''))), isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')))
- or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -550,7 +550,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$event_type'), ''), 'null'), '^"|"$', ''), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')), cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', ''))), isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')))
- or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -596,7 +596,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$event_type'), ''), 'null'), '^"|"$', ''), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')), cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', ''))), isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$external_click_url'), ''), 'null'), '^"|"$', '')))
- or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$host'), ''), 'null'), '^"|"$', '')))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.`$session_id`,
url)
GROUP BY `context.columns.url`
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_external_clicks_table.new_events_schema.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_external_clicks_table.new_events_schema.ambr
index db4de5ef8e69..6516b0c1634e 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_external_clicks_table.new_events_schema.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_external_clicks_table.new_events_schema.ambr
@@ -24,7 +24,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$event_type`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$event_type`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`))))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -90,7 +90,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$event_type`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$event_type`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`))))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -136,7 +136,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$event_type`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$event_type`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`))))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -182,7 +182,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$event_type`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$event_type`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`))))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -228,7 +228,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$event_type`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$event_type`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`))))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.person_properties.email, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.person_properties.email), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))))), '%@posthog.com%'), 1)))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.person_properties.email, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.person_properties.email), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))))), '%@posthog.com%'), 1)))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -274,7 +274,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$event_type`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$event_type`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`))))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-11 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-11 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -320,7 +320,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$event_type`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$event_type`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`))))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -366,7 +366,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$event_type`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$event_type`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`))))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -412,7 +412,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$event_type`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$event_type`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`))))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -458,7 +458,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$event_type`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$event_type`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`))))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -504,7 +504,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$event_type`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$event_type`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`))))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -550,7 +550,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$event_type`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$event_type`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`))))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -596,7 +596,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$event_type`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$event_type`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$event_type`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`))))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$external_click_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$external_click_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$external_click_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_notable_changes.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_notable_changes.ambr
index ff94be5ffa72..e6c5a3aafd2e 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_notable_changes.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_notable_changes.ambr
@@ -58,15 +58,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties,
'$pathname'), ''), 'null'), '^"|"$',
@@ -133,15 +133,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$entry_pathname`,
''), 'null'))
@@ -207,15 +207,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$entry_referring_domain`,
''), 'null'))
@@ -281,15 +281,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties,
'$device_type'), ''), 'null'), '^"|"$',
@@ -356,15 +356,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties,
'$browser'), ''), 'null'), '^"|"$',
@@ -431,15 +431,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties,
'$geoip_country_code'), ''), 'null'), '^"|"$',
@@ -535,15 +535,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$channel_type`,
''), 'null'))
@@ -609,15 +609,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$entry_utm_source`,
''), 'null'))
@@ -697,15 +697,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties,
'$pathname'), ''), 'null'), '^"|"$',
@@ -772,15 +772,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$entry_pathname`,
''), 'null'))
@@ -846,15 +846,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$entry_referring_domain`,
''), 'null'))
@@ -920,15 +920,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties,
'$device_type'), ''), 'null'), '^"|"$',
@@ -995,15 +995,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties,
'$browser'), ''), 'null'), '^"|"$',
@@ -1070,15 +1070,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties,
'$geoip_country_code'), ''), 'null'), '^"|"$',
@@ -1174,15 +1174,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$channel_type`,
''), 'null'))
@@ -1248,15 +1248,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$entry_utm_source`,
''), 'null'))
@@ -1336,15 +1336,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties,
'$pathname'), ''), 'null'), '^"|"$',
@@ -1411,15 +1411,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$entry_pathname`,
''), 'null'))
@@ -1485,15 +1485,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$entry_referring_domain`,
''), 'null'))
@@ -1559,15 +1559,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties,
'$device_type'), ''), 'null'), '^"|"$',
@@ -1634,15 +1634,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties,
'$browser'), ''), 'null'), '^"|"$',
@@ -1709,15 +1709,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties,
'$geoip_country_code'), ''), 'null'), '^"|"$',
@@ -1813,15 +1813,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$channel_type`,
''), 'null'))
@@ -1887,15 +1887,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$entry_utm_source`,
''), 'null'))
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_notable_changes.new_events_schema.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_notable_changes.new_events_schema.ambr
index bc9f51787b56..40cb127c801a 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_notable_changes.new_events_schema.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_notable_changes.new_events_schema.ambr
@@ -64,15 +64,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL,
if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`,
@@ -145,15 +145,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$entry_pathname`,
''), 'null'))
@@ -218,15 +218,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$entry_referring_domain`,
''), 'null'))
@@ -298,15 +298,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$device_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$device_type`)), if(isNull(nullIf(toString(events.properties.`$device_type`), '')), NULL,
if(startsWith(dynamicType(accurateCast(events.properties.`$device_type`,
@@ -386,15 +386,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL,
if(startsWith(dynamicType(accurateCast(events.properties.`$browser`,
@@ -474,15 +474,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$geoip_country_code`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$geoip_country_code`)), if(isNull(nullIf(toString(events.properties.`$geoip_country_code`), '')), NULL,
if(startsWith(dynamicType(accurateCast(events.properties.`$geoip_country_code`,
@@ -584,15 +584,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$channel_type`,
''), 'null'))
@@ -657,15 +657,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$entry_utm_source`,
''), 'null'))
@@ -751,15 +751,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL,
if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`,
@@ -832,15 +832,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$entry_pathname`,
''), 'null'))
@@ -905,15 +905,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$entry_referring_domain`,
''), 'null'))
@@ -985,15 +985,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$device_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$device_type`)), if(isNull(nullIf(toString(events.properties.`$device_type`), '')), NULL,
if(startsWith(dynamicType(accurateCast(events.properties.`$device_type`,
@@ -1073,15 +1073,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL,
if(startsWith(dynamicType(accurateCast(events.properties.`$browser`,
@@ -1161,15 +1161,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$geoip_country_code`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$geoip_country_code`)), if(isNull(nullIf(toString(events.properties.`$geoip_country_code`), '')), NULL,
if(startsWith(dynamicType(accurateCast(events.properties.`$geoip_country_code`,
@@ -1271,15 +1271,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$channel_type`,
''), 'null'))
@@ -1344,15 +1344,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$entry_utm_source`,
''), 'null'))
@@ -1438,15 +1438,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL,
if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`,
@@ -1519,15 +1519,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$entry_pathname`,
''), 'null'))
@@ -1592,15 +1592,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$entry_referring_domain`,
''), 'null'))
@@ -1672,15 +1672,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$device_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$device_type`)), if(isNull(nullIf(toString(events.properties.`$device_type`), '')), NULL,
if(startsWith(dynamicType(accurateCast(events.properties.`$device_type`,
@@ -1760,15 +1760,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL,
if(startsWith(dynamicType(accurateCast(events.properties.`$browser`,
@@ -1848,15 +1848,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$geoip_country_code`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$geoip_country_code`)), if(isNull(nullIf(toString(events.properties.`$geoip_country_code`), '')), NULL,
if(startsWith(dynamicType(accurateCast(events.properties.`$geoip_country_code`,
@@ -1958,15 +1958,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$channel_type`,
''), 'null'))
@@ -2031,15 +2031,15 @@
WHERE and(equals(events.team_id,
99999), and(or(equals(events.event,
'$pageview'), equals(events.event,
- '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59',
- 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-15 00:00:00',
- 'UTC'))), lessOrEquals(toTimeZone(events.timestamp,
- 'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
- 'UTC'))))), 1))
+ '$screen')), or(and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-29 23:59:59',
+ 'UTC')))), and(greaterOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-15 00:00:00',
+ 'UTC'))), lessOrEquals(events.timestamp,
+ assumeNotNull(toDateTime('2025-01-22 23:59:59',
+ 'UTC'))))), 1))
GROUP BY events__session.session_id,
nullIf(nullIf(events__session.`$entry_utm_source`,
''), 'null'))
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_bots.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_bots.ambr
index 19de97f61ab1..56a04b278646 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_bots.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_bots.ambr
@@ -6,7 +6,7 @@
count() AS Requests,
max(toTimeZone(events.timestamp, 'UTC')) AS `Last seen`
FROM events
- WHERE and(equals(events.team_id, 99999), and(ifNull(equals(accurateCastOrNull(or(ifNull(notEquals(multiMatchAnyIndex(ifNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$raw_user_agent'), ''), 'null'), '^"|"$', ''), ''), [/* 343 bot literals */]), 0), 1), or(/* bot ip ranges */)), 'Bool'), 1), 0), notEquals(if(ifNull(equals(multiMatchAnyIndex(ifNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$raw_user_agent'), ''), 'null'), '^"|"$', ''), ''), [/* 343 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 343 bot literals */][multiMatchAnyIndex(ifNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$raw_user_agent'), ''), 'null'), '^"|"$', ''), ''), [/* 343 bot literals */])]), ''), in(events.event, tuple('$pageview', '$screen', '$http_log')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-03-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-03-31 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(ifNull(equals(accurateCastOrNull(or(ifNull(notEquals(multiMatchAnyIndex(ifNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$raw_user_agent'), ''), 'null'), '^"|"$', ''), ''), [/* 343 bot literals */]), 0), 1), or(/* bot ip ranges */)), 'Bool'), 1), 0), notEquals(if(ifNull(equals(multiMatchAnyIndex(ifNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$raw_user_agent'), ''), 'null'), '^"|"$', ''), ''), [/* 343 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 343 bot literals */][multiMatchAnyIndex(ifNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$raw_user_agent'), ''), 'null'), '^"|"$', ''), ''), [/* 343 bot literals */])]), ''), in(events.event, tuple('$pageview', '$screen', '$http_log')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2026-03-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2026-03-31 23:59:59', 'UTC')))), 0), 1))
GROUP BY Crawler,
Category
ORDER BY Requests DESC
@@ -32,7 +32,7 @@
count() AS Requests,
max(toTimeZone(events.timestamp, 'UTC')) AS `Last seen`
FROM events
- WHERE and(equals(events.team_id, 99999), and(ifNull(equals(accurateCastOrNull(or(ifNull(notEquals(multiMatchAnyIndex(ifNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$raw_user_agent'), ''), 'null'), '^"|"$', ''), ''), [/* 343 bot literals */]), 0), 1), or(/* bot ip ranges */)), 'Bool'), 1), 0), notEquals(if(ifNull(equals(multiMatchAnyIndex(ifNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$raw_user_agent'), ''), 'null'), '^"|"$', ''), ''), [/* 343 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 343 bot literals */][multiMatchAnyIndex(ifNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$raw_user_agent'), ''), 'null'), '^"|"$', ''), ''), [/* 343 bot literals */])]), ''), in(events.event, tuple('$pageview', '$screen', '$http_log')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-01-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-01-31 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(ifNull(equals(accurateCastOrNull(or(ifNull(notEquals(multiMatchAnyIndex(ifNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$raw_user_agent'), ''), 'null'), '^"|"$', ''), ''), [/* 343 bot literals */]), 0), 1), or(/* bot ip ranges */)), 'Bool'), 1), 0), notEquals(if(ifNull(equals(multiMatchAnyIndex(ifNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$raw_user_agent'), ''), 'null'), '^"|"$', ''), ''), [/* 343 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 343 bot literals */][multiMatchAnyIndex(ifNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$raw_user_agent'), ''), 'null'), '^"|"$', ''), ''), [/* 343 bot literals */])]), ''), in(events.event, tuple('$pageview', '$screen', '$http_log')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2026-01-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2026-01-31 23:59:59', 'UTC')))), 0), 1))
GROUP BY Crawler,
Category
ORDER BY Requests DESC
@@ -58,7 +58,7 @@
count() AS Requests,
max(toTimeZone(events.timestamp, 'UTC')) AS `Last seen`
FROM events
- WHERE and(equals(events.team_id, 99999), and(ifNull(equals(accurateCastOrNull(or(ifNull(notEquals(multiMatchAnyIndex(ifNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$raw_user_agent'), ''), 'null'), '^"|"$', ''), ''), [/* 343 bot literals */]), 0), 1), or(/* bot ip ranges */)), 'Bool'), 1), 0), notEquals(if(ifNull(equals(multiMatchAnyIndex(ifNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$raw_user_agent'), ''), 'null'), '^"|"$', ''), ''), [/* 343 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 343 bot literals */][multiMatchAnyIndex(ifNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$raw_user_agent'), ''), 'null'), '^"|"$', ''), ''), [/* 343 bot literals */])]), ''), in(events.event, tuple('$pageview', '$screen', '$http_log')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', '')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-01-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-01-31 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(ifNull(equals(accurateCastOrNull(or(ifNull(notEquals(multiMatchAnyIndex(ifNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$raw_user_agent'), ''), 'null'), '^"|"$', ''), ''), [/* 343 bot literals */]), 0), 1), or(/* bot ip ranges */)), 'Bool'), 1), 0), notEquals(if(ifNull(equals(multiMatchAnyIndex(ifNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$raw_user_agent'), ''), 'null'), '^"|"$', ''), ''), [/* 343 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 343 bot literals */][multiMatchAnyIndex(ifNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$raw_user_agent'), ''), 'null'), '^"|"$', ''), ''), [/* 343 bot literals */])]), ''), in(events.event, tuple('$pageview', '$screen', '$http_log')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', '')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2026-01-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2026-01-31 23:59:59', 'UTC')))), 0), 1))
GROUP BY Path
ORDER BY Requests DESC
LIMIT 51
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_bots.new_events_schema.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_bots.new_events_schema.ambr
index 10983246f21c..6ac63571259b 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_bots.new_events_schema.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_bots.new_events_schema.ambr
@@ -6,7 +6,7 @@
count() AS Requests,
max(toTimeZone(events.timestamp, 'UTC')) AS `Last seen`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(ifNull(equals(accurateCastOrNull(or(ifNull(notEquals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$raw_user_agent`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$raw_user_agent`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`))))), ''), [/* 343 bot literals */]), 0), 1), or(/* bot ip ranges */)), 'Bool'), 1), 0), notEquals(if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$raw_user_agent`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$raw_user_agent`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`))))), ''), [/* 343 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 343 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$raw_user_agent`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$raw_user_agent`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`))))), ''), [/* 343 bot literals */])]), ''), in(events.event, tuple('$pageview', '$screen', '$http_log')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-03-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-03-31 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(ifNull(equals(accurateCastOrNull(or(ifNull(notEquals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$raw_user_agent`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$raw_user_agent`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`))))), ''), [/* 343 bot literals */]), 0), 1), or(/* bot ip ranges */)), 'Bool'), 1), 0), notEquals(if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$raw_user_agent`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$raw_user_agent`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`))))), ''), [/* 343 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 343 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$raw_user_agent`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$raw_user_agent`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`))))), ''), [/* 343 bot literals */])]), ''), in(events.event, tuple('$pageview', '$screen', '$http_log')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2026-03-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2026-03-31 23:59:59', 'UTC')))), 0), 1))
GROUP BY Crawler,
Category
ORDER BY Requests DESC
@@ -32,7 +32,7 @@
count() AS Requests,
max(toTimeZone(events.timestamp, 'UTC')) AS `Last seen`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(ifNull(equals(accurateCastOrNull(or(ifNull(notEquals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$raw_user_agent`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$raw_user_agent`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`))))), ''), [/* 343 bot literals */]), 0), 1), or(/* bot ip ranges */)), 'Bool'), 1), 0), notEquals(if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$raw_user_agent`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$raw_user_agent`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`))))), ''), [/* 343 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 343 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$raw_user_agent`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$raw_user_agent`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`))))), ''), [/* 343 bot literals */])]), ''), in(events.event, tuple('$pageview', '$screen', '$http_log')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-01-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-01-31 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(ifNull(equals(accurateCastOrNull(or(ifNull(notEquals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$raw_user_agent`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$raw_user_agent`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`))))), ''), [/* 343 bot literals */]), 0), 1), or(/* bot ip ranges */)), 'Bool'), 1), 0), notEquals(if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$raw_user_agent`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$raw_user_agent`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`))))), ''), [/* 343 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 343 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$raw_user_agent`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$raw_user_agent`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`))))), ''), [/* 343 bot literals */])]), ''), in(events.event, tuple('$pageview', '$screen', '$http_log')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2026-01-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2026-01-31 23:59:59', 'UTC')))), 0), 1))
GROUP BY Crawler,
Category
ORDER BY Requests DESC
@@ -58,7 +58,7 @@
count() AS Requests,
max(toTimeZone(events.timestamp, 'UTC')) AS `Last seen`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(ifNull(equals(accurateCastOrNull(or(ifNull(notEquals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$raw_user_agent`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$raw_user_agent`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`))))), ''), [/* 343 bot literals */]), 0), 1), or(/* bot ip ranges */)), 'Bool'), 1), 0), notEquals(if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$raw_user_agent`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$raw_user_agent`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`))))), ''), [/* 343 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 343 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$raw_user_agent`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$raw_user_agent`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`))))), ''), [/* 343 bot literals */])]), ''), in(events.event, tuple('$pageview', '$screen', '$http_log')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-01-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-01-31 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(ifNull(equals(accurateCastOrNull(or(ifNull(notEquals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$raw_user_agent`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$raw_user_agent`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`))))), ''), [/* 343 bot literals */]), 0), 1), or(/* bot ip ranges */)), 'Bool'), 1), 0), notEquals(if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$raw_user_agent`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$raw_user_agent`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`))))), ''), [/* 343 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 343 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$raw_user_agent`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$raw_user_agent`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$raw_user_agent`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`))))), ''), [/* 343 bot literals */])]), ''), in(events.event, tuple('$pageview', '$screen', '$http_log')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2026-01-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2026-01-31 23:59:59', 'UTC')))), 0), 1))
GROUP BY Path
ORDER BY Requests DESC
LIMIT 51
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_goals.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_goals.ambr
index 25f2aee305ac..a4530e010a93 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_goals.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_goals.ambr
@@ -68,7 +68,7 @@
FROM cohortpeople
WHERE and(equals(cohortpeople.team_id, 99999), equals(cohortpeople.cohort_id, 99999))
GROUP BY cohortpeople.person_id, cohortpeople.cohort_id, cohortpeople.version
- HAVING greater(sum(cohortpeople.sign), 0)))), and(equals(events.event, '$pageview'), ifNull(like(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), '%https://teest.com%'), 0)), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;).*?\\.ant\\-input[^;]*?($|;|:([^;^\\s]*(;|$|\\s)))'), ifNull(like(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), '%https://teest.com%'), 0)), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;).*?\\.ant\\-btn\\..*?text\\-white[^;]*?($|;|:([^;^\\s]*(;|$|\\s)))'), arrayExists(x -> ifNull(equals(x, 'text page'), 0), events.elements_chain_texts), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://teest.com'), 0)), and(equals(events.event, '$autocapture'), and(match(events.elements_chain, '(^|;)a[^;]*?($|;|:([^;^\\s]*(;|$|\\s))).*?\\.ant\\-btn[^;]*?($|;|:([^;^\\s]*(;|$|\\s)))'), greater(arrayCount(x -> in(x, ['a']), events.elements_chain_elements), 0)), arrayExists(x -> ifNull(equals(x, 'text'), 0), events.elements_chain_texts), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://teest.com'), 0)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), and(ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'mat_$host'), ''), 'null'), '^"|"$', ''), 'teest.com'), 0), ifNull(ilike(toString(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'mat_$current_url'), ''), 'null'), '^"|"$', '')), '%https://teest.com%'), 0)), 1))
+ HAVING greater(sum(cohortpeople.sign), 0)))), and(equals(events.event, '$pageview'), ifNull(like(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), '%https://teest.com%'), 0)), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;).*?\\.ant\\-input[^;]*?($|;|:([^;^\\s]*(;|$|\\s)))'), ifNull(like(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), '%https://teest.com%'), 0)), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;).*?\\.ant\\-btn\\..*?text\\-white[^;]*?($|;|:([^;^\\s]*(;|$|\\s)))'), arrayExists(x -> ifNull(equals(x, 'text page'), 0), events.elements_chain_texts), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://teest.com'), 0)), and(equals(events.event, '$autocapture'), and(match(events.elements_chain, '(^|;)a[^;]*?($|;|:([^;^\\s]*(;|$|\\s))).*?\\.ant\\-btn[^;]*?($|;|:([^;^\\s]*(;|$|\\s)))'), greater(arrayCount(x -> in(x, ['a']), events.elements_chain_elements), 0)), arrayExists(x -> ifNull(equals(x, 'text'), 0), events.elements_chain_texts), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://teest.com'), 0)))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), and(ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'mat_$host'), ''), 'null'), '^"|"$', ''), 'teest.com'), 0), ifNull(ilike(toString(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'mat_$current_url'), ''), 'null'), '^"|"$', '')), '%https://teest.com%'), 0)), 1))
GROUP BY events.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0)
LIMIT 100 SETTINGS readonly=2,
@@ -123,7 +123,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
- and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
+ and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
GROUP BY events.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))
LIMIT 100 SETTINGS readonly=2,
@@ -185,7 +185,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
- and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
+ and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
GROUP BY events.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))
LIMIT 100 SETTINGS readonly=2,
@@ -246,7 +246,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
- and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), 1, 1))
+ and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY events.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0)
LIMIT 100 SETTINGS readonly=2,
@@ -308,7 +308,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
- and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
+ and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
GROUP BY events.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))
LIMIT 100 SETTINGS readonly=2,
@@ -370,7 +370,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
- and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
+ and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
GROUP BY events.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))
LIMIT 100 SETTINGS readonly=2,
@@ -432,7 +432,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
- and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
+ and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
GROUP BY events.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))
LIMIT 100 SETTINGS readonly=2,
@@ -494,7 +494,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
- and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
+ and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
GROUP BY events.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))
LIMIT 100 SETTINGS readonly=2,
@@ -556,7 +556,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
- and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
+ and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
GROUP BY events.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))
LIMIT 100 SETTINGS readonly=2,
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_goals.new_events_schema.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_goals.new_events_schema.ambr
index 9a6cf68d27a0..bd5043cfc79f 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_goals.new_events_schema.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_goals.new_events_schema.ambr
@@ -65,7 +65,7 @@
FROM cohortpeople
WHERE and(equals(cohortpeople.team_id, 99999), equals(cohortpeople.cohort_id, 99999))
GROUP BY cohortpeople.person_id, cohortpeople.cohort_id, cohortpeople.version
- HAVING greater(sum(cohortpeople.sign), 0)))), and(equals(events.event, '$pageview'), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), '%https://teest.com%'), 0)), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;).*?\\.ant\\-input[^;]*?($|;|:([^;^\\s]*(;|$|\\s)))'), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), '%https://teest.com%'), 0)), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;).*?\\.ant\\-btn\\..*?text\\-white[^;]*?($|;|:([^;^\\s]*(;|$|\\s)))'), arrayExists(x -> ifNull(equals(x, 'text page'), 0), events.elements_chain_texts), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://teest.com'), 0)), and(equals(events.event, '$autocapture'), and(match(events.elements_chain, '(^|;)a[^;]*?($|;|:([^;^\\s]*(;|$|\\s))).*?\\.ant\\-btn[^;]*?($|;|:([^;^\\s]*(;|$|\\s)))'), greater(arrayCount(x -> in(x, ['a']), events.elements_chain_elements), 0)), arrayExists(x -> ifNull(equals(x, 'text'), 0), events.elements_chain_texts), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://teest.com'), 0)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`mat_$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`mat_$host`)), if(isNull(nullIf(toString(events.properties.`mat_$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`mat_$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`mat_$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`mat_$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`mat_$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`mat_$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`mat_$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`mat_$host`), '[]'), '{}'), toString(events.properties.`mat_$host`))))), 'teest.com'), 0), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`mat_$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`mat_$current_url`)), if(isNull(nullIf(toString(events.properties.`mat_$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`mat_$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`mat_$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`mat_$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`mat_$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`mat_$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`mat_$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`mat_$current_url`), '[]'), '{}'), toString(events.properties.`mat_$current_url`)))))), '%https://teest.com%'), 0)), 1))
+ HAVING greater(sum(cohortpeople.sign), 0)))), and(equals(events.event, '$pageview'), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), '%https://teest.com%'), 0)), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;).*?\\.ant\\-input[^;]*?($|;|:([^;^\\s]*(;|$|\\s)))'), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), '%https://teest.com%'), 0)), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;).*?\\.ant\\-btn\\..*?text\\-white[^;]*?($|;|:([^;^\\s]*(;|$|\\s)))'), arrayExists(x -> ifNull(equals(x, 'text page'), 0), events.elements_chain_texts), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://teest.com'), 0)), and(equals(events.event, '$autocapture'), and(match(events.elements_chain, '(^|;)a[^;]*?($|;|:([^;^\\s]*(;|$|\\s))).*?\\.ant\\-btn[^;]*?($|;|:([^;^\\s]*(;|$|\\s)))'), greater(arrayCount(x -> in(x, ['a']), events.elements_chain_elements), 0)), arrayExists(x -> ifNull(equals(x, 'text'), 0), events.elements_chain_texts), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://teest.com'), 0)))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`mat_$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`mat_$host`)), if(isNull(nullIf(toString(events.properties.`mat_$host`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`mat_$host`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`mat_$host`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`mat_$host`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`mat_$host`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`mat_$host`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`mat_$host`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`mat_$host`), '[]'), '{}'), toString(events.properties.`mat_$host`))))), 'teest.com'), 0), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`mat_$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`mat_$current_url`)), if(isNull(nullIf(toString(events.properties.`mat_$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`mat_$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`mat_$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`mat_$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`mat_$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`mat_$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`mat_$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`mat_$current_url`), '[]'), '{}'), toString(events.properties.`mat_$current_url`)))))), '%https://teest.com%'), 0)), 1))
GROUP BY events.properties.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0)
LIMIT 100 SETTINGS readonly=2,
@@ -120,7 +120,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
- and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
+ and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
GROUP BY events.properties.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))
LIMIT 100 SETTINGS readonly=2,
@@ -182,7 +182,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
- and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
+ and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
GROUP BY events.properties.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))
LIMIT 100 SETTINGS readonly=2,
@@ -243,7 +243,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
- and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), 1, 1))
+ and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY events.properties.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0)
LIMIT 100 SETTINGS readonly=2,
@@ -305,7 +305,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
- and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
+ and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
GROUP BY events.properties.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))
LIMIT 100 SETTINGS readonly=2,
@@ -367,7 +367,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
- and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
+ and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
GROUP BY events.properties.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))
LIMIT 100 SETTINGS readonly=2,
@@ -429,7 +429,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
- and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
+ and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
GROUP BY events.properties.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))
LIMIT 100 SETTINGS readonly=2,
@@ -491,7 +491,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
- and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
+ and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
GROUP BY events.properties.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))
LIMIT 100 SETTINGS readonly=2,
@@ -553,7 +553,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
- and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
+ and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
GROUP BY events.properties.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))
LIMIT 100 SETTINGS readonly=2,
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_overview.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_overview.ambr
index c4c909cddb1d..1706af2f3cc2 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_overview.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_overview.ambr
@@ -55,7 +55,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0))
LIMIT 100 SETTINGS readonly=2,
@@ -108,7 +108,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -161,7 +161,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -193,7 +193,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id_uuid`), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://www.example.com/bar'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
- and isNull('https://www.example.com/bar'))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ and isNull('https://www.example.com/bar'))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -244,7 +244,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -275,7 +275,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id_uuid`), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id_uuid`), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -326,7 +326,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -357,7 +357,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id_uuid`), equals(events.event, 'custom_event'), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id_uuid`), equals(events.event, 'custom_event'), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -408,7 +408,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -439,7 +439,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id_uuid`), equals(events.event, 'custom_event'), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id_uuid`), equals(events.event, 'custom_event'), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -490,7 +490,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -522,7 +522,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id_uuid`), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://www.example.com/foo'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
- and isNull('https://www.example.com/foo'))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ and isNull('https://www.example.com/foo'))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -573,7 +573,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -605,7 +605,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id_uuid`), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://www.example.com/foo'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
- and isNull('https://www.example.com/foo'))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ and isNull('https://www.example.com/foo'))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -656,7 +656,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'America/Los_Angeles'), assumeNotNull(toDateTime('2023-11-01 00:00:00', 'America/Los_Angeles'))), lessOrEquals(toTimeZone(events.timestamp, 'America/Los_Angeles'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'America/Los_Angeles')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-01 00:00:00', 'America/Los_Angeles'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'America/Los_Angeles')))), 0), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-01 00:00:00', 'America/Los_Angeles'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'America/Los_Angeles')))), 0))
LIMIT 100 SETTINGS readonly=2,
@@ -762,7 +762,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'America/Los_Angeles'), assumeNotNull(toDateTime('2023-11-01 00:00:00', 'America/Los_Angeles'))), lessOrEquals(toTimeZone(events.timestamp, 'America/Los_Angeles'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'America/Los_Angeles')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-01 00:00:00', 'America/Los_Angeles'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'America/Los_Angeles')))), 0), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-01 00:00:00', 'America/Los_Angeles'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'America/Los_Angeles')))), 0))
LIMIT 100 SETTINGS readonly=2,
@@ -868,7 +868,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -921,7 +921,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -974,12 +974,12 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), in(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id),
- (SELECT cohortpeople.person_id AS person_id
- FROM cohortpeople
- WHERE and(equals(cohortpeople.team_id, 99999), equals(cohortpeople.cohort_id, 99999))
- GROUP BY cohortpeople.person_id, cohortpeople.cohort_id, cohortpeople.version
- HAVING greater(sum(cohortpeople.sign), 0)))))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), in(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id),
+ (SELECT cohortpeople.person_id AS person_id
+ FROM cohortpeople
+ WHERE and(equals(cohortpeople.team_id, 99999), equals(cohortpeople.cohort_id, 99999))
+ GROUP BY cohortpeople.person_id, cohortpeople.cohort_id, cohortpeople.version
+ HAVING greater(sum(cohortpeople.sign), 0)))))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -1032,7 +1032,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), ifNull(notILike(toString(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.person_properties, 'email'), ''), 'null'), '^"|"$', '')), '%@posthog.com%'), 1)))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), ifNull(notILike(toString(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.person_properties, 'email'), ''), 'null'), '^"|"$', '')), '%@posthog.com%'), 1)))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -1085,14 +1085,14 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-30 23:59:59', 'UTC')))), 0), globalIn(events.`$session_id`,
- (SELECT session_id AS session_id
- FROM
- (SELECT events.`$session_id` AS session_id, argMinIf(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_campaign'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_medium'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_source'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$referring_domain'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'gclid'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'fbclid'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'gad_source'), ''), 'null'), '^"|"$', '')), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
- FROM events
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-30 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(events.`$session_id_uuid`)))
- GROUP BY session_id)
- WHERE ifNull(equals(multiIf(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), 'cross-network'), 'Cross Network', or(in(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), tuple('cpc', 'cpm', 'cpv', 'cpa', 'ppc', 'retargeting')), startsWith(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), 'paid'), isNotNull(nullIf(tupleElement(first_pageview_properties, 6), '')), isNotNull(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 8), ''), ''), 'null'))), coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Paid Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), '')), 'source'))), multiIf(ifNull(equals(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 8), ''), ''), 'null'), '1'), 0), 'Paid Search', match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*video.*)$'), 'Paid Video', isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')), 'Paid Social', 'Paid Unknown')), and(ifNull(equals(nullIf(tupleElement(first_pageview_properties, 5), ''), '$direct'), 0), isNull(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null'))), or(isNull(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null'))), in(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), tuple('(direct)', 'direct', '$direct'))), not(isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')))), 'Direct', coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Organic Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), '')), 'source'))), multiIf(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*video.*)$'), 'Organic Video', match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), 'push$'), 'Push', isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')), 'Organic Social', ifNull(equals(nullIf(tupleElement(first_pageview_properties, 5), ''), '$direct'), 0), 'Direct', isNotNull(nullIf(tupleElement(first_pageview_properties, 5), '')), 'Referral', 'Unknown'))), 'Paid Search'), 0)))))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-30 23:59:59', 'UTC')))), 0), globalIn(events.`$session_id`,
+ (SELECT session_id AS session_id
+ FROM
+ (SELECT events.`$session_id` AS session_id, argMinIf(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_campaign'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_medium'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_source'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$referring_domain'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'gclid'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'fbclid'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'gad_source'), ''), 'null'), '^"|"$', '')), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ FROM events
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-30 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(events.`$session_id_uuid`)))
+ GROUP BY session_id)
+ WHERE ifNull(equals(multiIf(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), 'cross-network'), 'Cross Network', or(in(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), tuple('cpc', 'cpm', 'cpv', 'cpa', 'ppc', 'retargeting')), startsWith(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), 'paid'), isNotNull(nullIf(tupleElement(first_pageview_properties, 6), '')), isNotNull(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 8), ''), ''), 'null'))), coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Paid Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), '')), 'source'))), multiIf(ifNull(equals(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 8), ''), ''), 'null'), '1'), 0), 'Paid Search', match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*video.*)$'), 'Paid Video', isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')), 'Paid Social', 'Paid Unknown')), and(ifNull(equals(nullIf(tupleElement(first_pageview_properties, 5), ''), '$direct'), 0), isNull(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null'))), or(isNull(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null'))), in(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), tuple('(direct)', 'direct', '$direct'))), not(isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')))), 'Direct', coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Organic Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), '')), 'source'))), multiIf(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*video.*)$'), 'Organic Video', match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), 'push$'), 'Push', isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')), 'Organic Social', ifNull(equals(nullIf(tupleElement(first_pageview_properties, 5), ''), '$direct'), 0), 'Direct', isNotNull(nullIf(tupleElement(first_pageview_properties, 5), '')), 'Referral', 'Unknown'))), 'Paid Search'), 0)))))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-06-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-06-30 23:59:59', 'UTC')))), 0))
LIMIT 100 SETTINGS readonly=2,
@@ -1146,7 +1146,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-30 23:59:59', 'UTC')))), 0), ifNull(equals(events__session.`$channel_type`, 'Paid Search'), 0)))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-30 23:59:59', 'UTC')))), 0), ifNull(equals(events__session.`$channel_type`, 'Paid Search'), 0)))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-06-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-06-30 23:59:59', 'UTC')))), 0))
LIMIT 100 SETTINGS readonly=2,
@@ -1199,7 +1199,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0))
LIMIT 100 SETTINGS readonly=2,
@@ -1230,7 +1230,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id_uuid`), and(equals(events.event, 'customer_created'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'plan'), ''), 'null'), '^"|"$', ''), 'paid'), 0)), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id_uuid`), and(equals(events.event, 'customer_created'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'plan'), ''), 'null'), '^"|"$', ''), 'paid'), 0)), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -1281,7 +1281,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'plan'), ''), 'null'), '^"|"$', ''), 'paid'), 0))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'plan'), ''), 'null'), '^"|"$', ''), 'paid'), 0))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1337,7 +1337,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1394,7 +1394,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'plan'), ''), 'null'), '^"|"$', ''), 'paid'), 0))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'plan'), ''), 'null'), '^"|"$', ''), 'paid'), 0))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1454,7 +1454,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0))
LIMIT 100 SETTINGS readonly=2,
@@ -1485,7 +1485,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id_uuid`), and(equals(events.event, 'customer_created'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'plan'), ''), 'null'), '^"|"$', ''), 'paid'), 0)), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id_uuid`), and(equals(events.event, 'customer_created'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'plan'), ''), 'null'), '^"|"$', ''), 'paid'), 0)), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -1536,7 +1536,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'plan'), ''), 'null'), '^"|"$', ''), 'paid'), 0))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'plan'), ''), 'null'), '^"|"$', ''), 'paid'), 0))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1592,7 +1592,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1649,7 +1649,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'plan'), ''), 'null'), '^"|"$', ''), 'paid'), 0))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'plan'), ''), 'null'), '^"|"$', ''), 'paid'), 0))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1709,7 +1709,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -1762,7 +1762,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -1815,7 +1815,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -1868,7 +1868,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -1921,7 +1921,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -1974,7 +1974,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -2006,7 +2006,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id_uuid`), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://www.example.com/foo'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
- and isNull('https://www.example.com/foo'))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
+ and isNull('https://www.example.com/foo'))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -2057,7 +2057,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0))
LIMIT 100 SETTINGS readonly=2,
@@ -2089,7 +2089,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.`$session_id_uuid`), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://www.example.com/foo'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
- and isNull('https://www.example.com/foo'))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ and isNull('https://www.example.com/foo'))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -2105,5 +2105,5 @@
'''
# ---
# name: TestWebOverviewSessionIdSetFastPath.test_session_id_set_pushes_id_filter_below_session_aggregation
- 'SELECT events_agg.unique_users AS unique_users, events_agg.previous_unique_users AS previous_unique_users, events_agg.total_filtered_pageview_count AS total_filtered_pageview_count, events_agg.previous_total_filtered_pageview_count AS previous_total_filtered_pageview_count, sessions_agg.unique_sessions AS unique_sessions, sessions_agg.previous_unique_sessions AS previous_unique_sessions, sessions_agg.avg_duration_s AS avg_duration_s, sessions_agg.previous_avg_duration_s AS previous_avg_duration_s, sessions_agg.bounce_rate AS bounce_rate, sessions_agg.previous_bounce_rate AS previous_bounce_rate FROM (SELECT uniqIf(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), and(greaterOrEquals(toTimeZone(events.timestamp, %(hogql_val_0)s), assumeNotNull(toDateTime(%(hogql_val_1)s, %(hogql_val_2)s))), lessOrEquals(toTimeZone(events.timestamp, %(hogql_val_3)s), assumeNotNull(toDateTime(%(hogql_val_4)s, %(hogql_val_5)s))))) AS unique_users, NULL AS previous_unique_users, countIf(and(greaterOrEquals(toTimeZone(events.timestamp, %(hogql_val_6)s), assumeNotNull(toDateTime(%(hogql_val_7)s, %(hogql_val_8)s))), lessOrEquals(toTimeZone(events.timestamp, %(hogql_val_9)s), assumeNotNull(toDateTime(%(hogql_val_10)s, %(hogql_val_11)s))))) AS total_filtered_pageview_count, NULL AS previous_total_filtered_pageview_count FROM events LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, <TEAM_ID>) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE and(equals(events.team_id, <TEAM_ID>), and(isNotNull(events.`$session_id_uuid`), or(equals(events.event, %(hogql_val_12)s), equals(events.event, %(hogql_val_13)s)), or(and(greaterOrEquals(toTimeZone(events.timestamp, %(hogql_val_14)s), assumeNotNull(toDateTime(%(hogql_val_15)s, %(hogql_val_16)s))), lessOrEquals(toTimeZone(events.timestamp, %(hogql_val_17)s), assumeNotNull(toDateTime(%(hogql_val_18)s, %(hogql_val_19)s)))), 0), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, %(hogql_val_20)s), \'\'), \'null\'), \'^"|"$\', \'\'), %(hogql_val_21)s), 0)))) AS events_agg CROSS JOIN (SELECT uniqIf(sessions.session_id, and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_43)s, %(hogql_val_44)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_45)s, %(hogql_val_46)s))))) AS unique_sessions, NULL AS previous_unique_sessions, avgIf(sessions.`$session_duration`, and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_47)s, %(hogql_val_48)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_49)s, %(hogql_val_50)s))))) AS avg_duration_s, NULL AS previous_avg_duration_s, avgIf(sessions.`$is_bounce`, and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_51)s, %(hogql_val_52)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_53)s, %(hogql_val_54)s))))) AS bounce_rate, NULL AS previous_bounce_rate FROM (SELECT toString(reinterpretAsUUID(bitOr(bitShiftLeft(raw_sessions.session_id_v7, 64), bitShiftRight(raw_sessions.session_id_v7, 64)))) AS session_id, min(toTimeZone(raw_sessions.min_timestamp, %(hogql_val_22)s)) AS `$start_timestamp`, dateDiff(%(hogql_val_23)s, min(toTimeZone(raw_sessions.min_timestamp, %(hogql_val_24)s)), max(toTimeZone(raw_sessions.max_timestamp, %(hogql_val_25)s))) AS `$session_duration`, if(equals(uniqMerge(raw_sessions.pageview_uniq), 0), NULL, not(or(greater(uniqMerge(raw_sessions.pageview_uniq), 1), greater(uniqMerge(raw_sessions.autocapture_uniq), 0), greaterOrEquals(dateDiff(%(hogql_val_26)s, min(toTimeZone(raw_sessions.min_timestamp, %(hogql_val_27)s)), max(toTimeZone(raw_sessions.max_timestamp, %(hogql_val_28)s))), 10)))) AS `$is_bounce`, uniqMerge(raw_sessions.pageview_uniq) AS `$pageview_count`, uniqMerge(raw_sessions.screen_uniq) AS `$screen_count`, raw_sessions.session_id_v7 AS session_id_v7 FROM raw_sessions WHERE and(equals(raw_sessions.team_id, <TEAM_ID>), and(greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime(%(hogql_val_29)s, %(hogql_val_30)s)), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime(%(hogql_val_31)s, %(hogql_val_32)s)), toIntervalDay(3)))), globalIn(raw_sessions.session_id_v7, (SELECT session_id_uuid AS session_id_uuid FROM (SELECT DISTINCT events.`$session_id_uuid` AS session_id_uuid FROM events WHERE and(equals(events.team_id, <TEAM_ID>), and(isNotNull(events.`$session_id_uuid`), or(equals(events.event, %(hogql_val_33)s), equals(events.event, %(hogql_val_34)s)), or(and(greaterOrEquals(toTimeZone(events.timestamp, %(hogql_val_35)s), assumeNotNull(toDateTime(%(hogql_val_36)s, %(hogql_val_37)s))), lessOrEquals(toTimeZone(events.timestamp, %(hogql_val_38)s), assumeNotNull(toDateTime(%(hogql_val_39)s, %(hogql_val_40)s)))), 0), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, %(hogql_val_41)s), \'\'), \'null\'), \'^"|"$\', \'\'), %(hogql_val_42)s), 0))))))) GROUP BY raw_sessions.session_id_v7) AS sessions WHERE and(or(and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_55)s, %(hogql_val_56)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_57)s, %(hogql_val_58)s)))), 0), or(greater(sessions.`$pageview_count`, 0), greater(sessions.`$screen_count`, 0)), 1)) AS sessions_agg LIMIT 50000'
+ 'SELECT events_agg.unique_users AS unique_users, events_agg.previous_unique_users AS previous_unique_users, events_agg.total_filtered_pageview_count AS total_filtered_pageview_count, events_agg.previous_total_filtered_pageview_count AS previous_total_filtered_pageview_count, sessions_agg.unique_sessions AS unique_sessions, sessions_agg.previous_unique_sessions AS previous_unique_sessions, sessions_agg.avg_duration_s AS avg_duration_s, sessions_agg.previous_avg_duration_s AS previous_avg_duration_s, sessions_agg.bounce_rate AS bounce_rate, sessions_agg.previous_bounce_rate AS previous_bounce_rate FROM (SELECT uniqIf(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), and(greaterOrEquals(toTimeZone(events.timestamp, %(hogql_val_0)s), assumeNotNull(toDateTime(%(hogql_val_1)s, %(hogql_val_2)s))), lessOrEquals(toTimeZone(events.timestamp, %(hogql_val_3)s), assumeNotNull(toDateTime(%(hogql_val_4)s, %(hogql_val_5)s))))) AS unique_users, NULL AS previous_unique_users, countIf(and(greaterOrEquals(toTimeZone(events.timestamp, %(hogql_val_6)s), assumeNotNull(toDateTime(%(hogql_val_7)s, %(hogql_val_8)s))), lessOrEquals(toTimeZone(events.timestamp, %(hogql_val_9)s), assumeNotNull(toDateTime(%(hogql_val_10)s, %(hogql_val_11)s))))) AS total_filtered_pageview_count, NULL AS previous_total_filtered_pageview_count FROM events LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, <TEAM_ID>) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE and(equals(events.team_id, <TEAM_ID>), and(isNotNull(events.`$session_id_uuid`), or(equals(events.event, %(hogql_val_12)s), equals(events.event, %(hogql_val_13)s)), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime(%(hogql_val_14)s, %(hogql_val_15)s))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime(%(hogql_val_16)s, %(hogql_val_17)s)))), 0), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, %(hogql_val_18)s), \'\'), \'null\'), \'^"|"$\', \'\'), %(hogql_val_19)s), 0)))) AS events_agg CROSS JOIN (SELECT uniqIf(sessions.session_id, and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_39)s, %(hogql_val_40)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_41)s, %(hogql_val_42)s))))) AS unique_sessions, NULL AS previous_unique_sessions, avgIf(sessions.`$session_duration`, and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_43)s, %(hogql_val_44)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_45)s, %(hogql_val_46)s))))) AS avg_duration_s, NULL AS previous_avg_duration_s, avgIf(sessions.`$is_bounce`, and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_47)s, %(hogql_val_48)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_49)s, %(hogql_val_50)s))))) AS bounce_rate, NULL AS previous_bounce_rate FROM (SELECT toString(reinterpretAsUUID(bitOr(bitShiftLeft(raw_sessions.session_id_v7, 64), bitShiftRight(raw_sessions.session_id_v7, 64)))) AS session_id, min(toTimeZone(raw_sessions.min_timestamp, %(hogql_val_20)s)) AS `$start_timestamp`, dateDiff(%(hogql_val_21)s, min(toTimeZone(raw_sessions.min_timestamp, %(hogql_val_22)s)), max(toTimeZone(raw_sessions.max_timestamp, %(hogql_val_23)s))) AS `$session_duration`, if(equals(uniqMerge(raw_sessions.pageview_uniq), 0), NULL, not(or(greater(uniqMerge(raw_sessions.pageview_uniq), 1), greater(uniqMerge(raw_sessions.autocapture_uniq), 0), greaterOrEquals(dateDiff(%(hogql_val_24)s, min(toTimeZone(raw_sessions.min_timestamp, %(hogql_val_25)s)), max(toTimeZone(raw_sessions.max_timestamp, %(hogql_val_26)s))), 10)))) AS `$is_bounce`, uniqMerge(raw_sessions.pageview_uniq) AS `$pageview_count`, uniqMerge(raw_sessions.screen_uniq) AS `$screen_count`, raw_sessions.session_id_v7 AS session_id_v7 FROM raw_sessions WHERE and(equals(raw_sessions.team_id, <TEAM_ID>), and(greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime(%(hogql_val_27)s, %(hogql_val_28)s)), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime(%(hogql_val_29)s, %(hogql_val_30)s)), toIntervalDay(3)))), globalIn(raw_sessions.session_id_v7, (SELECT session_id_uuid AS session_id_uuid FROM (SELECT DISTINCT events.`$session_id_uuid` AS session_id_uuid FROM events WHERE and(equals(events.team_id, <TEAM_ID>), and(isNotNull(events.`$session_id_uuid`), or(equals(events.event, %(hogql_val_31)s), equals(events.event, %(hogql_val_32)s)), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime(%(hogql_val_33)s, %(hogql_val_34)s))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime(%(hogql_val_35)s, %(hogql_val_36)s)))), 0), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, %(hogql_val_37)s), \'\'), \'null\'), \'^"|"$\', \'\'), %(hogql_val_38)s), 0))))))) GROUP BY raw_sessions.session_id_v7) AS sessions WHERE and(or(and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_51)s, %(hogql_val_52)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_53)s, %(hogql_val_54)s)))), 0), or(greater(sessions.`$pageview_count`, 0), greater(sessions.`$screen_count`, 0)), 1)) AS sessions_agg LIMIT 50000'
# ---
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_overview.new_events_schema.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_overview.new_events_schema.ambr
index e8fb9c603a9e..92594d31c11b 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_overview.new_events_schema.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_overview.new_events_schema.ambr
@@ -35,7 +35,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0))
LIMIT 100 SETTINGS readonly=2,
@@ -108,7 +108,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -140,7 +140,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://www.example.com/bar'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
- and isNull('https://www.example.com/bar'))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ and isNull('https://www.example.com/bar'))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -191,7 +191,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -222,7 +222,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -273,7 +273,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -304,7 +304,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), equals(events.event, 'custom_event'), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), equals(events.event, 'custom_event'), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -355,7 +355,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -386,7 +386,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), equals(events.event, 'custom_event'), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), equals(events.event, 'custom_event'), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -437,7 +437,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -469,7 +469,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
- and isNull('https://www.example.com/foo'))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ and isNull('https://www.example.com/foo'))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -520,7 +520,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -552,7 +552,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
- and isNull('https://www.example.com/foo'))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ and isNull('https://www.example.com/foo'))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -603,7 +603,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -709,7 +709,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'America/Los_Angeles'), assumeNotNull(toDateTime('2023-11-01 00:00:00', 'America/Los_Angeles'))), lessOrEquals(toTimeZone(events.timestamp, 'America/Los_Angeles'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'America/Los_Angeles')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-01 00:00:00', 'America/Los_Angeles'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'America/Los_Angeles')))), 0), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-01 00:00:00', 'America/Los_Angeles'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'America/Los_Angeles')))), 0))
LIMIT 100 SETTINGS readonly=2,
@@ -815,7 +815,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'America/Los_Angeles'), assumeNotNull(toDateTime('2023-11-01 00:00:00', 'America/Los_Angeles'))), lessOrEquals(toTimeZone(events.timestamp, 'America/Los_Angeles'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'America/Los_Angeles')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-01 00:00:00', 'America/Los_Angeles'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'America/Los_Angeles')))), 0), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-01 00:00:00', 'America/Los_Angeles'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'America/Los_Angeles')))), 0))
LIMIT 100 SETTINGS readonly=2,
@@ -868,7 +868,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -921,7 +921,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -974,12 +974,12 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), in(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id),
- (SELECT cohortpeople.person_id AS person_id
- FROM cohortpeople
- WHERE and(equals(cohortpeople.team_id, 99999), equals(cohortpeople.cohort_id, 99999))
- GROUP BY cohortpeople.person_id, cohortpeople.cohort_id, cohortpeople.version
- HAVING greater(sum(cohortpeople.sign), 0)))))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), in(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id),
+ (SELECT cohortpeople.person_id AS person_id
+ FROM cohortpeople
+ WHERE and(equals(cohortpeople.team_id, 99999), equals(cohortpeople.cohort_id, 99999))
+ GROUP BY cohortpeople.person_id, cohortpeople.cohort_id, cohortpeople.version
+ HAVING greater(sum(cohortpeople.sign), 0)))))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -1032,7 +1032,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.person_properties.email, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.person_properties.email), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))))), '%@posthog.com%'), 1)))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.person_properties.email, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.person_properties.email), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))))), '%@posthog.com%'), 1)))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -1086,7 +1086,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-30 23:59:59', 'UTC')))), 0), ifNull(equals(events__session.`$channel_type`, 'Paid Search'), 0)))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-30 23:59:59', 'UTC')))), 0), ifNull(equals(events__session.`$channel_type`, 'Paid Search'), 0)))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-06-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-06-30 23:59:59', 'UTC')))), 0))
LIMIT 100 SETTINGS readonly=2,
@@ -1139,14 +1139,14 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-30 23:59:59', 'UTC')))), 0), globalIn(events.properties.`$session_id`,
- (SELECT session_id AS session_id
- FROM
- (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_campaign, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_campaign, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_campaign), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_campaign, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_campaign, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_campaign, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_medium, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_medium), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_source, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_source), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$referring_domain`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$referring_domain`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.gclid, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.gclid, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.gclid), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.gclid, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.gclid, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.gclid, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.fbclid, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.fbclid, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.fbclid), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.fbclid, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.fbclid, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.fbclid, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.gad_source, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.gad_source, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.gad_source), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.gad_source, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.gad_source, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.gad_source, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source)))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
- FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-30 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
- GROUP BY session_id)
- WHERE ifNull(equals(multiIf(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), 'cross-network'), 'Cross Network', or(in(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), tuple('cpc', 'cpm', 'cpv', 'cpa', 'ppc', 'retargeting')), startsWith(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), 'paid'), isNotNull(nullIf(tupleElement(first_pageview_properties, 6), '')), isNotNull(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 8), ''), ''), 'null'))), coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Paid Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), '')), 'source'))), multiIf(ifNull(equals(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 8), ''), ''), 'null'), '1'), 0), 'Paid Search', match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*video.*)$'), 'Paid Video', isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')), 'Paid Social', 'Paid Unknown')), and(ifNull(equals(nullIf(tupleElement(first_pageview_properties, 5), ''), '$direct'), 0), isNull(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null'))), or(isNull(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null'))), in(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), tuple('(direct)', 'direct', '$direct'))), not(isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')))), 'Direct', coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Organic Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), '')), 'source'))), multiIf(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*video.*)$'), 'Organic Video', match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), 'push$'), 'Push', isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')), 'Organic Social', ifNull(equals(nullIf(tupleElement(first_pageview_properties, 5), ''), '$direct'), 0), 'Direct', isNotNull(nullIf(tupleElement(first_pageview_properties, 5), '')), 'Referral', 'Unknown'))), 'Paid Search'), 0)))))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-30 23:59:59', 'UTC')))), 0), globalIn(events.properties.`$session_id`,
+ (SELECT session_id AS session_id
+ FROM
+ (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_campaign, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_campaign, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_campaign), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_campaign, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_campaign, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_campaign, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_medium, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_medium), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_source, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_source), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$referring_domain`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$referring_domain`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.gclid, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.gclid, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.gclid), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.gclid, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.gclid, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.gclid, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.fbclid, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.fbclid, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.fbclid), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.fbclid, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.fbclid, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.fbclid, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.gad_source, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.gad_source, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.gad_source), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.gad_source, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.gad_source, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.gad_source, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source)))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-30 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ GROUP BY session_id)
+ WHERE ifNull(equals(multiIf(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), 'cross-network'), 'Cross Network', or(in(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), tuple('cpc', 'cpm', 'cpv', 'cpa', 'ppc', 'retargeting')), startsWith(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), 'paid'), isNotNull(nullIf(tupleElement(first_pageview_properties, 6), '')), isNotNull(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 8), ''), ''), 'null'))), coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Paid Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), '')), 'source'))), multiIf(ifNull(equals(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 8), ''), ''), 'null'), '1'), 0), 'Paid Search', match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*video.*)$'), 'Paid Video', isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')), 'Paid Social', 'Paid Unknown')), and(ifNull(equals(nullIf(tupleElement(first_pageview_properties, 5), ''), '$direct'), 0), isNull(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null'))), or(isNull(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null'))), in(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), tuple('(direct)', 'direct', '$direct'))), not(isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')))), 'Direct', coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Organic Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), '')), 'source'))), multiIf(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*video.*)$'), 'Organic Video', match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), 'push$'), 'Push', isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')), 'Organic Social', ifNull(equals(nullIf(tupleElement(first_pageview_properties, 5), ''), '$direct'), 0), 'Direct', isNotNull(nullIf(tupleElement(first_pageview_properties, 5), '')), 'Referral', 'Unknown'))), 'Paid Search'), 0)))))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-06-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-06-30 23:59:59', 'UTC')))), 0))
LIMIT 100 SETTINGS readonly=2,
@@ -1177,7 +1177,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.plan, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.plan), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan))))), 'paid'), 0)), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.plan, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.plan), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan))))), 'paid'), 0)), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -1228,7 +1228,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.plan, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.plan), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan))))), 'paid'), 0))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.plan, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.plan), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan))))), 'paid'), 0))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1284,7 +1284,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1341,7 +1341,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.plan, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.plan), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan))))), 'paid'), 0))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.plan, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.plan), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan))))), 'paid'), 0))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1401,7 +1401,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0))
LIMIT 100 SETTINGS readonly=2,
@@ -1432,7 +1432,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.plan, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.plan), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan))))), 'paid'), 0)), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.plan, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.plan), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan))))), 'paid'), 0)), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -1483,7 +1483,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.plan, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.plan), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan))))), 'paid'), 0))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.plan, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.plan), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan))))), 'paid'), 0))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1539,7 +1539,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1596,7 +1596,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.plan, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.plan), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan))))), 'paid'), 0))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.plan, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.plan), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.plan, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan))))), 'paid'), 0))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1656,7 +1656,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0))
LIMIT 100 SETTINGS readonly=2,
@@ -1709,7 +1709,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -1762,7 +1762,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -1815,7 +1815,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -1868,7 +1868,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -1921,7 +1921,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -1953,7 +1953,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
- and isNull('https://www.example.com/foo'))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
+ and isNull('https://www.example.com/foo'))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -2004,7 +2004,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -2036,7 +2036,7 @@
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
- and isNull('https://www.example.com/foo'))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ and isNull('https://www.example.com/foo'))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -2087,7 +2087,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0))
LIMIT 100 SETTINGS readonly=2,
@@ -2105,5 +2105,5 @@
'''
# ---
# name: TestWebOverviewSessionIdSetFastPath.test_session_id_set_pushes_id_filter_below_session_aggregation[new_events_schema]
- "SELECT events_agg.unique_users AS unique_users, events_agg.previous_unique_users AS previous_unique_users, events_agg.total_filtered_pageview_count AS total_filtered_pageview_count, events_agg.previous_total_filtered_pageview_count AS previous_total_filtered_pageview_count, sessions_agg.unique_sessions AS unique_sessions, sessions_agg.previous_unique_sessions AS previous_unique_sessions, sessions_agg.avg_duration_s AS avg_duration_s, sessions_agg.previous_avg_duration_s AS previous_avg_duration_s, sessions_agg.bounce_rate AS bounce_rate, sessions_agg.previous_bounce_rate AS previous_bounce_rate FROM (SELECT uniqIf(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), and(greaterOrEquals(toTimeZone(events.timestamp, %(hogql_val_0)s), assumeNotNull(toDateTime(%(hogql_val_1)s, %(hogql_val_2)s))), lessOrEquals(toTimeZone(events.timestamp, %(hogql_val_3)s), assumeNotNull(toDateTime(%(hogql_val_4)s, %(hogql_val_5)s))))) AS unique_users, NULL AS previous_unique_users, countIf(and(greaterOrEquals(toTimeZone(events.timestamp, %(hogql_val_6)s), assumeNotNull(toDateTime(%(hogql_val_7)s, %(hogql_val_8)s))), lessOrEquals(toTimeZone(events.timestamp, %(hogql_val_9)s), assumeNotNull(toDateTime(%(hogql_val_10)s, %(hogql_val_11)s))))) AS total_filtered_pageview_count, NULL AS previous_total_filtered_pageview_count FROM events_json AS events LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, <TEAM_ID>) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE and(equals(events.team_id, <TEAM_ID>), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), or(equals(events.event, %(hogql_val_12)s), equals(events.event, %(hogql_val_13)s)), or(and(greaterOrEquals(toTimeZone(events.timestamp, %(hogql_val_14)s), assumeNotNull(toDateTime(%(hogql_val_15)s, %(hogql_val_16)s))), lessOrEquals(toTimeZone(events.timestamp, %(hogql_val_17)s), assumeNotNull(toDateTime(%(hogql_val_18)s, %(hogql_val_19)s)))), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \\'UTC\\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), %(hogql_val_20)s), 0)))) AS events_agg CROSS JOIN (SELECT uniqIf(sessions.session_id, and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_41)s, %(hogql_val_42)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_43)s, %(hogql_val_44)s))))) AS unique_sessions, NULL AS previous_unique_sessions, avgIf(sessions.`$session_duration`, and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_45)s, %(hogql_val_46)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_47)s, %(hogql_val_48)s))))) AS avg_duration_s, NULL AS previous_avg_duration_s, avgIf(sessions.`$is_bounce`, and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_49)s, %(hogql_val_50)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_51)s, %(hogql_val_52)s))))) AS bounce_rate, NULL AS previous_bounce_rate FROM (SELECT toString(reinterpretAsUUID(bitOr(bitShiftLeft(raw_sessions.session_id_v7, 64), bitShiftRight(raw_sessions.session_id_v7, 64)))) AS session_id, min(toTimeZone(raw_sessions.min_timestamp, %(hogql_val_21)s)) AS `$start_timestamp`, dateDiff(%(hogql_val_22)s, min(toTimeZone(raw_sessions.min_timestamp, %(hogql_val_23)s)), max(toTimeZone(raw_sessions.max_timestamp, %(hogql_val_24)s))) AS `$session_duration`, if(equals(uniqMerge(raw_sessions.pageview_uniq), 0), NULL, not(or(greater(uniqMerge(raw_sessions.pageview_uniq), 1), greater(uniqMerge(raw_sessions.autocapture_uniq), 0), greaterOrEquals(dateDiff(%(hogql_val_25)s, min(toTimeZone(raw_sessions.min_timestamp, %(hogql_val_26)s)), max(toTimeZone(raw_sessions.max_timestamp, %(hogql_val_27)s))), 10)))) AS `$is_bounce`, uniqMerge(raw_sessions.pageview_uniq) AS `$pageview_count`, uniqMerge(raw_sessions.screen_uniq) AS `$screen_count`, raw_sessions.session_id_v7 AS session_id_v7 FROM raw_sessions WHERE and(equals(raw_sessions.team_id, <TEAM_ID>), and(greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime(%(hogql_val_28)s, %(hogql_val_29)s)), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime(%(hogql_val_30)s, %(hogql_val_31)s)), toIntervalDay(3)))), globalIn(raw_sessions.session_id_v7, (SELECT session_id_uuid AS session_id_uuid FROM (SELECT DISTINCT toUInt128(toUUIDOrNull(events.properties.`$session_id`)) AS session_id_uuid FROM events_json AS events WHERE and(equals(events.team_id, <TEAM_ID>), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), or(equals(events.event, %(hogql_val_32)s), equals(events.event, %(hogql_val_33)s)), or(and(greaterOrEquals(toTimeZone(events.timestamp, %(hogql_val_34)s), assumeNotNull(toDateTime(%(hogql_val_35)s, %(hogql_val_36)s))), lessOrEquals(toTimeZone(events.timestamp, %(hogql_val_37)s), assumeNotNull(toDateTime(%(hogql_val_38)s, %(hogql_val_39)s)))), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \\'UTC\\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), %(hogql_val_40)s), 0))))))) GROUP BY raw_sessions.session_id_v7) AS sessions WHERE and(or(and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_53)s, %(hogql_val_54)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_55)s, %(hogql_val_56)s)))), 0), or(greater(sessions.`$pageview_count`, 0), greater(sessions.`$screen_count`, 0)), 1)) AS sessions_agg LIMIT 50000"
+ "SELECT events_agg.unique_users AS unique_users, events_agg.previous_unique_users AS previous_unique_users, events_agg.total_filtered_pageview_count AS total_filtered_pageview_count, events_agg.previous_total_filtered_pageview_count AS previous_total_filtered_pageview_count, sessions_agg.unique_sessions AS unique_sessions, sessions_agg.previous_unique_sessions AS previous_unique_sessions, sessions_agg.avg_duration_s AS avg_duration_s, sessions_agg.previous_avg_duration_s AS previous_avg_duration_s, sessions_agg.bounce_rate AS bounce_rate, sessions_agg.previous_bounce_rate AS previous_bounce_rate FROM (SELECT uniqIf(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), and(greaterOrEquals(toTimeZone(events.timestamp, %(hogql_val_0)s), assumeNotNull(toDateTime(%(hogql_val_1)s, %(hogql_val_2)s))), lessOrEquals(toTimeZone(events.timestamp, %(hogql_val_3)s), assumeNotNull(toDateTime(%(hogql_val_4)s, %(hogql_val_5)s))))) AS unique_users, NULL AS previous_unique_users, countIf(and(greaterOrEquals(toTimeZone(events.timestamp, %(hogql_val_6)s), assumeNotNull(toDateTime(%(hogql_val_7)s, %(hogql_val_8)s))), lessOrEquals(toTimeZone(events.timestamp, %(hogql_val_9)s), assumeNotNull(toDateTime(%(hogql_val_10)s, %(hogql_val_11)s))))) AS total_filtered_pageview_count, NULL AS previous_total_filtered_pageview_count FROM events_json AS events LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, <TEAM_ID>) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE and(equals(events.team_id, <TEAM_ID>), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), or(equals(events.event, %(hogql_val_12)s), equals(events.event, %(hogql_val_13)s)), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime(%(hogql_val_14)s, %(hogql_val_15)s))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime(%(hogql_val_16)s, %(hogql_val_17)s)))), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \\'UTC\\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), %(hogql_val_18)s), 0)))) AS events_agg CROSS JOIN (SELECT uniqIf(sessions.session_id, and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_37)s, %(hogql_val_38)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_39)s, %(hogql_val_40)s))))) AS unique_sessions, NULL AS previous_unique_sessions, avgIf(sessions.`$session_duration`, and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_41)s, %(hogql_val_42)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_43)s, %(hogql_val_44)s))))) AS avg_duration_s, NULL AS previous_avg_duration_s, avgIf(sessions.`$is_bounce`, and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_45)s, %(hogql_val_46)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_47)s, %(hogql_val_48)s))))) AS bounce_rate, NULL AS previous_bounce_rate FROM (SELECT toString(reinterpretAsUUID(bitOr(bitShiftLeft(raw_sessions.session_id_v7, 64), bitShiftRight(raw_sessions.session_id_v7, 64)))) AS session_id, min(toTimeZone(raw_sessions.min_timestamp, %(hogql_val_19)s)) AS `$start_timestamp`, dateDiff(%(hogql_val_20)s, min(toTimeZone(raw_sessions.min_timestamp, %(hogql_val_21)s)), max(toTimeZone(raw_sessions.max_timestamp, %(hogql_val_22)s))) AS `$session_duration`, if(equals(uniqMerge(raw_sessions.pageview_uniq), 0), NULL, not(or(greater(uniqMerge(raw_sessions.pageview_uniq), 1), greater(uniqMerge(raw_sessions.autocapture_uniq), 0), greaterOrEquals(dateDiff(%(hogql_val_23)s, min(toTimeZone(raw_sessions.min_timestamp, %(hogql_val_24)s)), max(toTimeZone(raw_sessions.max_timestamp, %(hogql_val_25)s))), 10)))) AS `$is_bounce`, uniqMerge(raw_sessions.pageview_uniq) AS `$pageview_count`, uniqMerge(raw_sessions.screen_uniq) AS `$screen_count`, raw_sessions.session_id_v7 AS session_id_v7 FROM raw_sessions WHERE and(equals(raw_sessions.team_id, <TEAM_ID>), and(greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime(%(hogql_val_26)s, %(hogql_val_27)s)), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime(%(hogql_val_28)s, %(hogql_val_29)s)), toIntervalDay(3)))), globalIn(raw_sessions.session_id_v7, (SELECT session_id_uuid AS session_id_uuid FROM (SELECT DISTINCT toUInt128(toUUIDOrNull(events.properties.`$session_id`)) AS session_id_uuid FROM events_json AS events WHERE and(equals(events.team_id, <TEAM_ID>), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), or(equals(events.event, %(hogql_val_30)s), equals(events.event, %(hogql_val_31)s)), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime(%(hogql_val_32)s, %(hogql_val_33)s))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime(%(hogql_val_34)s, %(hogql_val_35)s)))), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \\'UTC\\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), %(hogql_val_36)s), 0))))))) GROUP BY raw_sessions.session_id_v7) AS sessions WHERE and(or(and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_49)s, %(hogql_val_50)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_51)s, %(hogql_val_52)s)))), 0), or(greater(sessions.`$pageview_count`, 0), greater(sessions.`$screen_count`, 0)), 1)) AS sessions_agg LIMIT 50000"
# ---
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_pre_aggregated.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_pre_aggregated.ambr
index bb93ea7be41e..42c06a90e092 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_pre_aggregated.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_pre_aggregated.ambr
@@ -44,7 +44,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-02 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-02 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -111,7 +111,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-02 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-02 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -178,7 +178,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-02 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-02 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -255,7 +255,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-02 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-02 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_pre_aggregated.new_events_schema.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_pre_aggregated.new_events_schema.ambr
index 888db2102cfd..9d92bdcd0a92 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_pre_aggregated.new_events_schema.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_pre_aggregated.new_events_schema.ambr
@@ -19,7 +19,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-02 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-02 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -61,7 +61,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-02 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-02 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -113,7 +113,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-02 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-02 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -155,7 +155,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-01-02 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-01-02 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_table.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_table.ambr
index c53528d8f799..571e616a92da 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_table.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_table.ambr
@@ -39,7 +39,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -97,7 +97,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -108,7 +108,7 @@
quantileIf(0.9)(least(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_duration'), ''), 'null'), '^"|"$', ''), 'Float64'), 86400),
and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))) AS previous_avg_time_on_page
FROM events
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_pathname'), ''), 'null'), '^"|"$', '')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_duration'), ''), 'null'), '^"|"$', '')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_pathname'), ''), 'null'), '^"|"$', '')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_duration'), ''), 'null'), '^"|"$', '')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), 1, 1))
GROUP BY breakdown_value) AS time_on_page ON equals(counts.breakdown_value, time_on_page.breakdown_value)
LEFT JOIN
(SELECT breakdown_value AS breakdown_value,
@@ -129,7 +129,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), or(and(greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')), toIntervalDay(3)))), and(greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC')), toIntervalDay(3))))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(events.`$session_id_uuid`, events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -207,7 +207,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -218,7 +218,7 @@
quantileIf(0.9)(least(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_duration'), ''), 'null'), '^"|"$', ''), 'Float64'), 86400),
0) AS previous_avg_time_on_page
FROM events
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_pathname'), ''), 'null'), '^"|"$', '')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_duration'), ''), 'null'), '^"|"$', '')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_pathname'), ''), 'null'), '^"|"$', '')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_duration'), ''), 'null'), '^"|"$', '')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY breakdown_value) AS time_on_page ON equals(counts.breakdown_value, time_on_page.breakdown_value)
LEFT JOIN
(SELECT breakdown_value AS breakdown_value,
@@ -239,7 +239,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(events.`$session_id_uuid`, events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -317,7 +317,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -328,7 +328,7 @@
quantileIf(0.9)(least(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_duration'), ''), 'null'), '^"|"$', ''), 'Float64'), 86400),
0) AS previous_avg_time_on_page
FROM events
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_pathname'), ''), 'null'), '^"|"$', '')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_duration'), ''), 'null'), '^"|"$', '')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_pathname'), ''), 'null'), '^"|"$', '')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_duration'), ''), 'null'), '^"|"$', '')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY breakdown_value) AS time_on_page ON equals(counts.breakdown_value, time_on_page.breakdown_value)
LEFT JOIN
(SELECT breakdown_value AS breakdown_value,
@@ -349,7 +349,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(events.`$session_id_uuid`, events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -427,7 +427,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -438,7 +438,7 @@
quantileIf(0.9)(least(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_duration'), ''), 'null'), '^"|"$', ''), 'Float64'), 86400),
0) AS previous_avg_time_on_page
FROM events
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_pathname'), ''), 'null'), '^"|"$', '')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_duration'), ''), 'null'), '^"|"$', '')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_pathname'), ''), 'null'), '^"|"$', '')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_duration'), ''), 'null'), '^"|"$', '')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY breakdown_value) AS time_on_page ON equals(counts.breakdown_value, time_on_page.breakdown_value)
LEFT JOIN
(SELECT breakdown_value AS breakdown_value,
@@ -459,7 +459,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(events.`$session_id_uuid`, events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -536,7 +536,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -559,7 +559,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(events.`$session_id_uuid`, events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -636,7 +636,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -659,7 +659,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(events.`$session_id_uuid`, events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -736,7 +736,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -759,7 +759,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(events.`$session_id_uuid`, events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -836,7 +836,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), in(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', ''), tuple('/onboarding/portfolio-selection', '/')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), in(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', ''), tuple('/onboarding/portfolio-selection', '/')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -859,7 +859,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(events.`$session_id_uuid`, events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -936,7 +936,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', ''), '/a'), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', ''), '/a'), 0), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -959,7 +959,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(events.`$session_id_uuid`, events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -1012,7 +1012,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1085,10 +1085,10 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), in(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id),
- (SELECT cohortpeople.person_id AS person_id
- FROM cohortpeople
- WHERE and(equals(cohortpeople.team_id, 99999), equals(cohortpeople.cohort_id, 99999), equals(cohortpeople.version, 0))))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), in(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id),
+ (SELECT cohortpeople.person_id AS person_id
+ FROM cohortpeople
+ WHERE and(equals(cohortpeople.team_id, 99999), equals(cohortpeople.cohort_id, 99999), equals(cohortpeople.version, 0))))))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1131,7 +1131,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1189,8 +1189,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://www.example.com/bar'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
- and isNull('https://www.example.com/bar')))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://www.example.com/bar'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
+ and isNull('https://www.example.com/bar')))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1248,7 +1248,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1305,7 +1305,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), equals(events.event, 'custom_event')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), equals(events.event, 'custom_event')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1362,7 +1362,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), equals(events.event, 'custom_event')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), equals(events.event, 'custom_event')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1420,8 +1420,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://www.example.com/foo'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
- and isNull('https://www.example.com/foo')))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://www.example.com/foo'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
+ and isNull('https://www.example.com/foo')))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1480,8 +1480,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://www.example.com/foo'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
- and isNull('https://www.example.com/foo')))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://www.example.com/foo'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
+ and isNull('https://www.example.com/foo')))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1540,8 +1540,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://www.example.com/foo'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
- and isNull('https://www.example.com/foo')))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), 'https://www.example.com/foo'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
+ and isNull('https://www.example.com/foo')))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1585,7 +1585,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1659,7 +1659,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1733,7 +1733,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1807,7 +1807,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1881,7 +1881,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', ''), '/a'), 0)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', ''), '/a'), 0)))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1924,7 +1924,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(notILike(toString(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.person_properties, 'email'), ''), 'null'), '^"|"$', '')), '%@posthog.com%'), 1)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(notILike(toString(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.person_properties, 'email'), ''), 'null'), '^"|"$', '')), '%@posthog.com%'), 1)))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1993,7 +1993,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
HAVING and(isNotNull(`context.columns.breakdown_value`), ifNull(notEquals(`context.columns.breakdown_value`, ''), 1))
@@ -2041,7 +2041,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -2108,7 +2108,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -2179,7 +2179,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -2231,7 +2231,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -2280,7 +2280,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -2327,7 +2327,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
HAVING and(isNotNull(`context.columns.breakdown_value`), ifNull(notEquals(`context.columns.breakdown_value`, ''), 1))
@@ -2401,7 +2401,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), equals(events.event, 'custom_event')), 1, isNotNull(events.`$session_id_uuid`)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), equals(events.event, 'custom_event')), 1, isNotNull(events.`$session_id_uuid`)))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.unique_conversions` DESC,
@@ -2473,7 +2473,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -2525,7 +2525,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -2574,7 +2574,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -2621,7 +2621,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
HAVING and(isNotNull(`context.columns.breakdown_value`), ifNull(notEquals(`context.columns.breakdown_value`, ''), 1))
@@ -2689,14 +2689,14 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.`$session_id`,
- (SELECT session_id AS session_id
- FROM
- (SELECT events.`$session_id` AS session_id, argMinIf(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_campaign'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_medium'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_source'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$referring_domain'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'gclid'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'fbclid'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'gad_source'), ''), 'null'), '^"|"$', '')), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
- FROM events
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(events.`$session_id_uuid`)))
- GROUP BY session_id)
- WHERE ifNull(equals(multiIf(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), 'cross-network'), 'Cross Network', or(in(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), tuple('cpc', 'cpm', 'cpv', 'cpa', 'ppc', 'retargeting')), startsWith(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), 'paid'), isNotNull(nullIf(tupleElement(first_pageview_properties, 6), '')), isNotNull(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 8), ''), ''), 'null'))), coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Paid Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), '')), 'source'))), multiIf(ifNull(equals(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 8), ''), ''), 'null'), '1'), 0), 'Paid Search', match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*video.*)$'), 'Paid Video', isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')), 'Paid Social', 'Paid Unknown')), and(ifNull(equals(nullIf(tupleElement(first_pageview_properties, 5), ''), '$direct'), 0), isNull(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null'))), or(isNull(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null'))), in(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), tuple('(direct)', 'direct', '$direct'))), not(isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')))), 'Direct', coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Organic Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), '')), 'source'))), multiIf(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*video.*)$'), 'Organic Video', match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), 'push$'), 'Push', isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')), 'Organic Social', ifNull(equals(nullIf(tupleElement(first_pageview_properties, 5), ''), '$direct'), 0), 'Direct', isNotNull(nullIf(tupleElement(first_pageview_properties, 5), '')), 'Referral', 'Unknown'))), 'Paid Search'), 0))), isNotNull(events.`$session_id_uuid`)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.`$session_id`,
+ (SELECT session_id AS session_id
+ FROM
+ (SELECT events.`$session_id` AS session_id, argMinIf(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_campaign'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_medium'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_source'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$referring_domain'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'gclid'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'fbclid'), ''), 'null'), '^"|"$', ''), replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'gad_source'), ''), 'null'), '^"|"$', '')), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ FROM events
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(events.`$session_id_uuid`)))
+ GROUP BY session_id)
+ WHERE ifNull(equals(multiIf(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), 'cross-network'), 'Cross Network', or(in(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), tuple('cpc', 'cpm', 'cpv', 'cpa', 'ppc', 'retargeting')), startsWith(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), 'paid'), isNotNull(nullIf(tupleElement(first_pageview_properties, 6), '')), isNotNull(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 8), ''), ''), 'null'))), coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Paid Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), '')), 'source'))), multiIf(ifNull(equals(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 8), ''), ''), 'null'), '1'), 0), 'Paid Search', match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*video.*)$'), 'Paid Video', isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')), 'Paid Social', 'Paid Unknown')), and(ifNull(equals(nullIf(tupleElement(first_pageview_properties, 5), ''), '$direct'), 0), isNull(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null'))), or(isNull(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null'))), in(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), tuple('(direct)', 'direct', '$direct'))), not(isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')))), 'Direct', coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Organic Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), '')), 'source'))), multiIf(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*video.*)$'), 'Organic Video', match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), 'push$'), 'Push', isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')), 'Organic Social', ifNull(equals(nullIf(tupleElement(first_pageview_properties, 5), ''), '$direct'), 0), 'Direct', isNotNull(nullIf(tupleElement(first_pageview_properties, 5), '')), 'Referral', 'Unknown'))), 'Paid Search'), 0))), isNotNull(events.`$session_id_uuid`)))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
HAVING and(isNotNull(`context.columns.breakdown_value`), ifNull(notEquals(`context.columns.breakdown_value`, ''), 1))
@@ -2748,7 +2748,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(events__session.`$channel_type`, 'Paid Search'), 0)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(events__session.`$channel_type`, 'Paid Search'), 0)))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -2817,14 +2817,14 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.`$session_id`,
- (SELECT session_id AS session_id
- FROM
- (SELECT events.`$session_id` AS session_id, argMinIf(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_source'), ''), 'null'), '^"|"$', '')), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
- FROM events
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(events.`$session_id_uuid`)))
- GROUP BY session_id)
- WHERE ifNull(equals(nullIf(tupleElement(first_pageview_properties, 1), ''), 'google'), 0))), isNotNull(events.`$session_id_uuid`)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.`$session_id`,
+ (SELECT session_id AS session_id
+ FROM
+ (SELECT events.`$session_id` AS session_id, argMinIf(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_source'), ''), 'null'), '^"|"$', '')), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ FROM events
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(events.`$session_id_uuid`)))
+ GROUP BY session_id)
+ WHERE ifNull(equals(nullIf(tupleElement(first_pageview_properties, 1), ''), 'google'), 0))), isNotNull(events.`$session_id_uuid`)))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -2875,7 +2875,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(events__session.`$entry_utm_source`, 'google'), 0)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(events__session.`$entry_utm_source`, 'google'), 0)))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -2943,14 +2943,14 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.`$session_id`,
- (SELECT session_id AS session_id
- FROM
- (SELECT events.`$session_id` AS session_id, argMinIf(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$referring_domain'), ''), 'null'), '^"|"$', '')), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
- FROM events
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(events.`$session_id_uuid`)))
- GROUP BY session_id)
- WHERE ifNull(equals(nullIf(tupleElement(first_pageview_properties, 1), ''), 'google.com'), 0))), isNotNull(events.`$session_id_uuid`)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.`$session_id`,
+ (SELECT session_id AS session_id
+ FROM
+ (SELECT events.`$session_id` AS session_id, argMinIf(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$referring_domain'), ''), 'null'), '^"|"$', '')), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ FROM events
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(events.`$session_id_uuid`)))
+ GROUP BY session_id)
+ WHERE ifNull(equals(nullIf(tupleElement(first_pageview_properties, 1), ''), 'google.com'), 0))), isNotNull(events.`$session_id_uuid`)))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -3001,7 +3001,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(events__session.`$entry_referring_domain`, 'google.com'), 0)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(events__session.`$entry_referring_domain`, 'google.com'), 0)))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -3069,14 +3069,14 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.`$session_id`,
- (SELECT session_id AS session_id
- FROM
- (SELECT events.`$session_id` AS session_id, argMinIf(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_medium'), ''), 'null'), '^"|"$', '')), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
- FROM events
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(events.`$session_id_uuid`)))
- GROUP BY session_id)
- WHERE in(nullIf(tupleElement(first_pageview_properties, 1), ''), tuple('paid', 'cpc', 'ppc', 'paidsearch', 'paidSocial', 'paid_social')))), isNotNull(events.`$session_id_uuid`)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.`$session_id`,
+ (SELECT session_id AS session_id
+ FROM
+ (SELECT events.`$session_id` AS session_id, argMinIf(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_medium'), ''), 'null'), '^"|"$', '')), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ FROM events
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(events.`$session_id_uuid`)))
+ GROUP BY session_id)
+ WHERE in(nullIf(tupleElement(first_pageview_properties, 1), ''), tuple('paid', 'cpc', 'ppc', 'paidsearch', 'paidSocial', 'paid_social')))), isNotNull(events.`$session_id_uuid`)))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -3143,14 +3143,14 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.`$session_id`,
- (SELECT session_id AS session_id
- FROM
- (SELECT events.`$session_id` AS session_id, argMinIf(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_medium'), ''), 'null'), '^"|"$', '')), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
- FROM events
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(events.`$session_id_uuid`)))
- GROUP BY session_id)
- WHERE in(nullIf(tupleElement(first_pageview_properties, 1), ''), tuple('cpc', 'email')))), isNotNull(events.`$session_id_uuid`)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.`$session_id`,
+ (SELECT session_id AS session_id
+ FROM
+ (SELECT events.`$session_id` AS session_id, argMinIf(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_medium'), ''), 'null'), '^"|"$', '')), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ FROM events
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(events.`$session_id_uuid`)))
+ GROUP BY session_id)
+ WHERE in(nullIf(tupleElement(first_pageview_properties, 1), ''), tuple('cpc', 'email')))), isNotNull(events.`$session_id_uuid`)))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -3217,14 +3217,14 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.`$session_id`,
- (SELECT session_id AS session_id
- FROM
- (SELECT events.`$session_id` AS session_id, argMinIf(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_medium'), ''), 'null'), '^"|"$', '')), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
- FROM events
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(events.`$session_id_uuid`)))
- GROUP BY session_id)
- WHERE ifNull(equals(nullIf(tupleElement(first_pageview_properties, 1), ''), 'cpc'), 0))), isNotNull(events.`$session_id_uuid`)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.`$session_id`,
+ (SELECT session_id AS session_id
+ FROM
+ (SELECT events.`$session_id` AS session_id, argMinIf(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_medium'), ''), 'null'), '^"|"$', '')), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ FROM events
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(events.`$session_id_uuid`)))
+ GROUP BY session_id)
+ WHERE ifNull(equals(nullIf(tupleElement(first_pageview_properties, 1), ''), 'cpc'), 0))), isNotNull(events.`$session_id_uuid`)))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -3291,7 +3291,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -3358,14 +3358,14 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.`$session_id`,
- (SELECT session_id AS session_id
- FROM
- (SELECT events.`$session_id` AS session_id, argMinIf(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_medium'), ''), 'null'), '^"|"$', '')), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
- FROM events
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(events.`$session_id_uuid`)))
- GROUP BY session_id)
- WHERE ifNull(notIn(nullIf(tupleElement(first_pageview_properties, 1), ''), tuple('cpc', 'paid')), 1))), isNotNull(events.`$session_id_uuid`)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.`$session_id`,
+ (SELECT session_id AS session_id
+ FROM
+ (SELECT events.`$session_id` AS session_id, argMinIf(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_medium'), ''), 'null'), '^"|"$', '')), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ FROM events
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(events.`$session_id_uuid`)))
+ GROUP BY session_id)
+ WHERE ifNull(notIn(nullIf(tupleElement(first_pageview_properties, 1), ''), tuple('cpc', 'paid')), 1))), isNotNull(events.`$session_id_uuid`)))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -3432,7 +3432,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
HAVING and(isNotNull(`context.columns.breakdown_value`), ifNull(notEquals(`context.columns.breakdown_value`, ''), 1))
@@ -3500,7 +3500,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
HAVING and(isNotNull(`context.columns.breakdown_value`), ifNull(notEquals(`context.columns.breakdown_value`, ''), 1))
@@ -3568,7 +3568,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(events.`$session_id_uuid`)))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
HAVING and(isNotNull(`context.columns.breakdown_value`), ifNull(notEquals(`context.columns.breakdown_value`, ''), 1))
@@ -3610,7 +3610,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-11 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-11 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -3673,7 +3673,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -3747,7 +3747,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -3821,7 +3821,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -3895,7 +3895,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -3958,7 +3958,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4031,7 +4031,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4104,7 +4104,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4179,7 +4179,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4242,7 +4242,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4285,7 +4285,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4328,7 +4328,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-11 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-11 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4371,7 +4371,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-11 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-11 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4444,7 +4444,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_source'), ''), 'null'), '^"|"$', ''))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'utm_source'), ''), 'null'), '^"|"$', ''))))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4507,7 +4507,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(notILike(toString(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.person_properties, 'email'), ''), 'null'), '^"|"$', '')), '%@posthog.com%'), 1)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(notILike(toString(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.person_properties, 'email'), ''), 'null'), '^"|"$', '')), '%@posthog.com%'), 1)))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4569,7 +4569,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4612,7 +4612,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4655,7 +4655,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4728,7 +4728,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4781,7 +4781,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4824,7 +4824,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4897,7 +4897,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4974,7 +4974,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -4985,7 +4985,7 @@
quantileIf(0.9)(least(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_duration'), ''), 'null'), '^"|"$', ''), 'Float64'), 86400),
0) AS previous_avg_time_on_page
FROM events
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_pathname'), ''), 'null'), '^"|"$', '')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_duration'), ''), 'null'), '^"|"$', '')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_pathname'), ''), 'null'), '^"|"$', '')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_duration'), ''), 'null'), '^"|"$', '')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY breakdown_value) AS time_on_page ON equals(counts.breakdown_value, time_on_page.breakdown_value)
LEFT JOIN
(SELECT breakdown_value AS breakdown_value,
@@ -5006,7 +5006,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(events.`$session_id_uuid`, events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -5069,7 +5069,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5132,7 +5132,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5195,7 +5195,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5258,8 +5258,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(replaceRegexpAll(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', ''), '\\/cleaned\\/\\d+', '/cleaned/:id'), replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id')), isNull(replaceRegexpAll(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', ''), '\\/cleaned\\/\\d+', '/cleaned/:id'))
- and isNull(replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id')))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(replaceRegexpAll(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', ''), '\\/cleaned\\/\\d+', '/cleaned/:id'), replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id')), isNull(replaceRegexpAll(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', ''), '\\/cleaned\\/\\d+', '/cleaned/:id'))
+ and isNull(replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id')))))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5322,8 +5322,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', ''), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'), replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/:id', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')), isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', ''), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'))
- and isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/:id', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', ''), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'), replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/:id', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')), isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', ''), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'))
+ and isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/:id', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')))))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5366,8 +5366,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', ''), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'), replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')), isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', ''), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'))
- and isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', ''), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'), replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')), isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', ''), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'))
+ and isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')))))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5430,7 +5430,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5493,7 +5493,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-06 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-06 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5566,7 +5566,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5608,7 +5608,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5665,7 +5665,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -5688,7 +5688,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(events.`$session_id_uuid`, events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -5765,7 +5765,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -5788,7 +5788,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(events.`$session_id_uuid`, events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -5846,7 +5846,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -5869,7 +5869,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(events.`$session_id_uuid`, events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -5928,8 +5928,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), '/foo'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
- and isNull('/foo')))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), '/foo'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
+ and isNull('/foo')))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5989,8 +5989,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), '/foo'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
- and isNull('/foo')))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), '/foo'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
+ and isNull('/foo')))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6050,8 +6050,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), '/foo'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
- and isNull('/foo')))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), '/foo'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
+ and isNull('/foo')))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6110,8 +6110,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), '/foo'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
- and isNull('/foo')))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''), '/foo'), isNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$current_url'), ''), 'null'), '^"|"$', ''))
+ and isNull('/foo')))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6175,7 +6175,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6218,7 +6218,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6281,7 +6281,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6324,7 +6324,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6400,7 +6400,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6478,7 +6478,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -6489,7 +6489,7 @@
quantileIf(0.9)(least(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_duration'), ''), 'null'), '^"|"$', ''), 'Float64'), 86400),
0) AS previous_avg_time_on_page
FROM events
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_pathname'), ''), 'null'), '^"|"$', '')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_duration'), ''), 'null'), '^"|"$', '')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_pathname'), ''), 'null'), '^"|"$', '')), isNotNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$prev_pageview_duration'), ''), 'null'), '^"|"$', '')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY breakdown_value) AS time_on_page ON equals(counts.breakdown_value, time_on_page.breakdown_value)
LEFT JOIN
(SELECT breakdown_value AS breakdown_value,
@@ -6510,7 +6510,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(events.`$session_id_uuid`, events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -6553,7 +6553,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-15 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-15 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6615,7 +6615,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6657,7 +6657,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6699,7 +6699,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_table.new_events_schema.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_table.new_events_schema.ambr
index 76283bd47725..08358b3ac3f4 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_table.new_events_schema.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_table.new_events_schema.ambr
@@ -19,7 +19,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -97,7 +97,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -108,7 +108,7 @@
quantileIf(0.9)(least(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'Float64'), 86400),
and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))) AS previous_avg_time_on_page
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))))), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_duration`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`)))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))))), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_duration`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`)))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), 1, 1))
GROUP BY breakdown_value) AS time_on_page ON equals(counts.breakdown_value, time_on_page.breakdown_value)
LEFT JOIN
(SELECT breakdown_value AS breakdown_value,
@@ -129,7 +129,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), or(and(greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')), toIntervalDay(3)))), and(greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC')), toIntervalDay(3))))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -187,7 +187,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -198,7 +198,7 @@
quantileIf(0.9)(least(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'Float64'), 86400),
0) AS previous_avg_time_on_page
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))))), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_duration`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`)))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))))), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_duration`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`)))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY breakdown_value) AS time_on_page ON equals(counts.breakdown_value, time_on_page.breakdown_value)
LEFT JOIN
(SELECT breakdown_value AS breakdown_value,
@@ -219,7 +219,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -297,7 +297,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -308,7 +308,7 @@
quantileIf(0.9)(least(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'Float64'), 86400),
0) AS previous_avg_time_on_page
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))))), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_duration`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`)))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))))), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_duration`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`)))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY breakdown_value) AS time_on_page ON equals(counts.breakdown_value, time_on_page.breakdown_value)
LEFT JOIN
(SELECT breakdown_value AS breakdown_value,
@@ -329,7 +329,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -407,7 +407,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -418,7 +418,7 @@
quantileIf(0.9)(least(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'Float64'), 86400),
0) AS previous_avg_time_on_page
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))))), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_duration`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`)))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))))), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_duration`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`)))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY breakdown_value) AS time_on_page ON equals(counts.breakdown_value, time_on_page.breakdown_value)
LEFT JOIN
(SELECT breakdown_value AS breakdown_value,
@@ -439,7 +439,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -516,7 +516,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -539,7 +539,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -616,7 +616,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -639,7 +639,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -716,7 +716,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -739,7 +739,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -816,7 +816,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), tuple('/onboarding/portfolio-selection', '/')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), tuple('/onboarding/portfolio-selection', '/')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -839,7 +839,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -916,7 +916,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '/a'), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '/a'), 0), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -939,7 +939,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -1012,7 +1012,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1055,10 +1055,10 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), in(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id),
- (SELECT cohortpeople.person_id AS person_id
- FROM cohortpeople
- WHERE and(equals(cohortpeople.team_id, 99999), equals(cohortpeople.cohort_id, 99999), equals(cohortpeople.version, 0))))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), in(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id),
+ (SELECT cohortpeople.person_id AS person_id
+ FROM cohortpeople
+ WHERE and(equals(cohortpeople.team_id, 99999), equals(cohortpeople.cohort_id, 99999), equals(cohortpeople.version, 0))))))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1121,7 +1121,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1179,8 +1179,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://www.example.com/bar'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
- and isNull('https://www.example.com/bar')))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://www.example.com/bar'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
+ and isNull('https://www.example.com/bar')))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1238,7 +1238,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1295,7 +1295,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), equals(events.event, 'custom_event')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), equals(events.event, 'custom_event')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1352,7 +1352,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), equals(events.event, 'custom_event')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), equals(events.event, 'custom_event')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1410,8 +1410,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
- and isNull('https://www.example.com/foo')))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
+ and isNull('https://www.example.com/foo')))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1470,8 +1470,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
- and isNull('https://www.example.com/foo')))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
+ and isNull('https://www.example.com/foo')))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1530,8 +1530,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
- and isNull('https://www.example.com/foo')))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
+ and isNull('https://www.example.com/foo')))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1575,7 +1575,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1629,7 +1629,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1703,7 +1703,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1777,7 +1777,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1851,7 +1851,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '/a'), 0)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '/a'), 0)))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1914,7 +1914,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.person_properties.email, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.person_properties.email), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))))), '%@posthog.com%'), 1)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.person_properties.email, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.person_properties.email), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))))), '%@posthog.com%'), 1)))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1963,7 +1963,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
HAVING and(isNotNull(`context.columns.breakdown_value`), ifNull(notEquals(`context.columns.breakdown_value`, ''), 1))
@@ -2011,7 +2011,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -2078,7 +2078,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -2149,7 +2149,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -2201,7 +2201,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -2250,7 +2250,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -2297,7 +2297,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
HAVING and(isNotNull(`context.columns.breakdown_value`), ifNull(notEquals(`context.columns.breakdown_value`, ''), 1))
@@ -2371,7 +2371,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), equals(events.event, 'custom_event')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), equals(events.event, 'custom_event')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.unique_conversions` DESC,
@@ -2443,7 +2443,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -2495,7 +2495,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -2544,7 +2544,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -2591,7 +2591,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
HAVING and(isNotNull(`context.columns.breakdown_value`), ifNull(notEquals(`context.columns.breakdown_value`, ''), 1))
@@ -2659,14 +2659,14 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.properties.`$session_id`,
- (SELECT session_id AS session_id
- FROM
- (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_campaign, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_campaign, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_campaign), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_campaign, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_campaign, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_campaign, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_medium, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_medium), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_source, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_source), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$referring_domain`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$referring_domain`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.gclid, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.gclid, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.gclid), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.gclid, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.gclid, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.gclid, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.fbclid, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.fbclid, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.fbclid), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.fbclid, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.fbclid, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.fbclid, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.gad_source, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.gad_source, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.gad_source), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.gad_source, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.gad_source, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.gad_source, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source)))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
- FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
- GROUP BY session_id)
- WHERE ifNull(equals(multiIf(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), 'cross-network'), 'Cross Network', or(in(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), tuple('cpc', 'cpm', 'cpv', 'cpa', 'ppc', 'retargeting')), startsWith(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), 'paid'), isNotNull(nullIf(tupleElement(first_pageview_properties, 6), '')), isNotNull(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 8), ''), ''), 'null'))), coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Paid Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), '')), 'source'))), multiIf(ifNull(equals(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 8), ''), ''), 'null'), '1'), 0), 'Paid Search', match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*video.*)$'), 'Paid Video', isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')), 'Paid Social', 'Paid Unknown')), and(ifNull(equals(nullIf(tupleElement(first_pageview_properties, 5), ''), '$direct'), 0), isNull(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null'))), or(isNull(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null'))), in(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), tuple('(direct)', 'direct', '$direct'))), not(isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')))), 'Direct', coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Organic Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), '')), 'source'))), multiIf(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*video.*)$'), 'Organic Video', match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), 'push$'), 'Push', isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')), 'Organic Social', ifNull(equals(nullIf(tupleElement(first_pageview_properties, 5), ''), '$direct'), 0), 'Direct', isNotNull(nullIf(tupleElement(first_pageview_properties, 5), '')), 'Referral', 'Unknown'))), 'Paid Search'), 0))), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.properties.`$session_id`,
+ (SELECT session_id AS session_id
+ FROM
+ (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_campaign, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_campaign, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_campaign), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_campaign, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_campaign, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_campaign, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_medium, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_medium), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_source, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_source), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$referring_domain`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$referring_domain`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.gclid, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.gclid, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.gclid), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.gclid, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.gclid, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.gclid, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.fbclid, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.fbclid, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.fbclid), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.fbclid, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.fbclid, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.fbclid, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid))))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.gad_source, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.gad_source, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.gad_source), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.gad_source, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.gad_source, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.gad_source, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source)))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ GROUP BY session_id)
+ WHERE ifNull(equals(multiIf(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), 'cross-network'), 'Cross Network', or(in(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), tuple('cpc', 'cpm', 'cpv', 'cpa', 'ppc', 'retargeting')), startsWith(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), 'paid'), isNotNull(nullIf(tupleElement(first_pageview_properties, 6), '')), isNotNull(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 8), ''), ''), 'null'))), coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Paid Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), '')), 'source'))), multiIf(ifNull(equals(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 8), ''), ''), 'null'), '1'), 0), 'Paid Search', match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*video.*)$'), 'Paid Video', isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')), 'Paid Social', 'Paid Unknown')), and(ifNull(equals(nullIf(tupleElement(first_pageview_properties, 5), ''), '$direct'), 0), isNull(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null'))), or(isNull(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null'))), in(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), tuple('(direct)', 'direct', '$direct'))), not(isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')))), 'Direct', coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 3), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Organic Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(nullIf(tupleElement(first_pageview_properties, 5), ''), '')), 'source'))), multiIf(match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 1), ''), ''), 'null')), '^(.*video.*)$'), 'Organic Video', match(lower(nullIf(nullIf(nullIf(tupleElement(first_pageview_properties, 2), ''), ''), 'null')), 'push$'), 'Push', isNotNull(nullIf(tupleElement(first_pageview_properties, 7), '')), 'Organic Social', ifNull(equals(nullIf(tupleElement(first_pageview_properties, 5), ''), '$direct'), 0), 'Direct', isNotNull(nullIf(tupleElement(first_pageview_properties, 5), '')), 'Referral', 'Unknown'))), 'Paid Search'), 0))), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
HAVING and(isNotNull(`context.columns.breakdown_value`), ifNull(notEquals(`context.columns.breakdown_value`, ''), 1))
@@ -2718,7 +2718,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(events__session.`$channel_type`, 'Paid Search'), 0)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(events__session.`$channel_type`, 'Paid Search'), 0)))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -2787,14 +2787,14 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.properties.`$session_id`,
- (SELECT session_id AS session_id
- FROM
- (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_source, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_source), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
- FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
- GROUP BY session_id)
- WHERE ifNull(equals(nullIf(tupleElement(first_pageview_properties, 1), ''), 'google'), 0))), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.properties.`$session_id`,
+ (SELECT session_id AS session_id
+ FROM
+ (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_source, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_source), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ GROUP BY session_id)
+ WHERE ifNull(equals(nullIf(tupleElement(first_pageview_properties, 1), ''), 'google'), 0))), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -2845,7 +2845,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(events__session.`$entry_utm_source`, 'google'), 0)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(events__session.`$entry_utm_source`, 'google'), 0)))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -2913,14 +2913,14 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.properties.`$session_id`,
- (SELECT session_id AS session_id
- FROM
- (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$referring_domain`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$referring_domain`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`)))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
- FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
- GROUP BY session_id)
- WHERE ifNull(equals(nullIf(tupleElement(first_pageview_properties, 1), ''), 'google.com'), 0))), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.properties.`$session_id`,
+ (SELECT session_id AS session_id
+ FROM
+ (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$referring_domain`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$referring_domain`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$referring_domain`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`)))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ GROUP BY session_id)
+ WHERE ifNull(equals(nullIf(tupleElement(first_pageview_properties, 1), ''), 'google.com'), 0))), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -2971,7 +2971,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(events__session.`$entry_referring_domain`, 'google.com'), 0)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(events__session.`$entry_referring_domain`, 'google.com'), 0)))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -3039,14 +3039,14 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.properties.`$session_id`,
- (SELECT session_id AS session_id
- FROM
- (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_medium, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_medium), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
- FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
- GROUP BY session_id)
- WHERE in(nullIf(tupleElement(first_pageview_properties, 1), ''), tuple('paid', 'cpc', 'ppc', 'paidsearch', 'paidSocial', 'paid_social')))), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.properties.`$session_id`,
+ (SELECT session_id AS session_id
+ FROM
+ (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_medium, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_medium), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ GROUP BY session_id)
+ WHERE in(nullIf(tupleElement(first_pageview_properties, 1), ''), tuple('paid', 'cpc', 'ppc', 'paidsearch', 'paidSocial', 'paid_social')))), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -3113,14 +3113,14 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.properties.`$session_id`,
- (SELECT session_id AS session_id
- FROM
- (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_medium, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_medium), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
- FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
- GROUP BY session_id)
- WHERE in(nullIf(tupleElement(first_pageview_properties, 1), ''), tuple('cpc', 'email')))), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.properties.`$session_id`,
+ (SELECT session_id AS session_id
+ FROM
+ (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_medium, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_medium), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ GROUP BY session_id)
+ WHERE in(nullIf(tupleElement(first_pageview_properties, 1), ''), tuple('cpc', 'email')))), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -3187,14 +3187,14 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.properties.`$session_id`,
- (SELECT session_id AS session_id
- FROM
- (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_medium, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_medium), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
- FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
- GROUP BY session_id)
- WHERE ifNull(equals(nullIf(tupleElement(first_pageview_properties, 1), ''), 'cpc'), 0))), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.properties.`$session_id`,
+ (SELECT session_id AS session_id
+ FROM
+ (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_medium, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_medium), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ GROUP BY session_id)
+ WHERE ifNull(equals(nullIf(tupleElement(first_pageview_properties, 1), ''), 'cpc'), 0))), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -3261,7 +3261,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -3328,14 +3328,14 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.properties.`$session_id`,
- (SELECT session_id AS session_id
- FROM
- (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_medium, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_medium), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
- FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
- GROUP BY session_id)
- WHERE ifNull(notIn(nullIf(tupleElement(first_pageview_properties, 1), ''), tuple('cpc', 'paid')), 1))), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.properties.`$session_id`,
+ (SELECT session_id AS session_id
+ FROM
+ (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_medium, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_medium), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_medium, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ GROUP BY session_id)
+ WHERE ifNull(notIn(nullIf(tupleElement(first_pageview_properties, 1), ''), tuple('cpc', 'paid')), 1))), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
ORDER BY `context.columns.visitors` DESC,
@@ -3402,7 +3402,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
HAVING and(isNotNull(`context.columns.breakdown_value`), ifNull(notEquals(`context.columns.breakdown_value`, ''), 1))
@@ -3470,7 +3470,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
HAVING and(isNotNull(`context.columns.breakdown_value`), ifNull(notEquals(`context.columns.breakdown_value`, ''), 1))
@@ -3538,7 +3538,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1, isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id))
GROUP BY `context.columns.breakdown_value`
HAVING and(isNotNull(`context.columns.breakdown_value`), ifNull(notEquals(`context.columns.breakdown_value`, ''), 1))
@@ -3600,7 +3600,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-11 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-11 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -3643,7 +3643,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -3717,7 +3717,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -3791,7 +3791,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -3865,7 +3865,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 10:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -3928,7 +3928,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4001,7 +4001,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4074,7 +4074,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4149,7 +4149,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4212,7 +4212,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4255,7 +4255,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4318,7 +4318,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-11 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-11 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4361,7 +4361,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-11 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-11 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4414,7 +4414,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_source, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_source), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source))))))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.utm_source, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.utm_source), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.utm_source, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source))))))))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4477,7 +4477,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.person_properties.email, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.person_properties.email), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))))), '%@posthog.com%'), 1)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.person_properties.email, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.person_properties.email), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.person_properties.email, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))))), '%@posthog.com%'), 1)))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4539,7 +4539,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4582,7 +4582,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4645,7 +4645,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4698,7 +4698,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4751,7 +4751,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4794,7 +4794,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4867,7 +4867,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4944,7 +4944,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -4955,7 +4955,7 @@
quantileIf(0.9)(least(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'Float64'), 86400),
0) AS previous_avg_time_on_page
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))))), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_duration`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`)))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))))), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_duration`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`)))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY breakdown_value) AS time_on_page ON equals(counts.breakdown_value, time_on_page.breakdown_value)
LEFT JOIN
(SELECT breakdown_value AS breakdown_value,
@@ -4976,7 +4976,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -5039,7 +5039,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5102,7 +5102,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5165,7 +5165,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5228,8 +5228,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '\\/cleaned\\/\\d+', '/cleaned/:id'), replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id')), isNull(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '\\/cleaned\\/\\d+', '/cleaned/:id'))
- and isNull(replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id')))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '\\/cleaned\\/\\d+', '/cleaned/:id'), replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id')), isNull(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '\\/cleaned\\/\\d+', '/cleaned/:id'))
+ and isNull(replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id')))))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5292,8 +5292,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'), replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/:id', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')), isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'))
- and isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/:id', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'), replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/:id', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')), isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'))
+ and isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/:id', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')))))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5336,8 +5336,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'), replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')), isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'))
- and isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'), replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')), isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'))
+ and isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')))))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5400,7 +5400,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5463,7 +5463,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-06 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-06 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5536,7 +5536,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5578,7 +5578,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5635,7 +5635,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -5658,7 +5658,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-31 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -5735,7 +5735,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -5758,7 +5758,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -5816,7 +5816,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -5839,7 +5839,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -5918,8 +5918,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), '/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
- and isNull('/foo')))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), '/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
+ and isNull('/foo')))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -5979,8 +5979,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), '/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
- and isNull('/foo')))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), '/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
+ and isNull('/foo')))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6040,8 +6040,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), '/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
- and isNull('/foo')))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), '/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
+ and isNull('/foo')))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6100,8 +6100,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), '/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
- and isNull('/foo')))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))), '/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$current_url`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$current_url`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$current_url`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`))))))
+ and isNull('/foo')))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6145,7 +6145,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6188,7 +6188,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6251,7 +6251,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6294,7 +6294,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6370,7 +6370,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-26 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6448,7 +6448,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -6459,7 +6459,7 @@
quantileIf(0.9)(least(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'Float64'), 86400),
0) AS previous_avg_time_on_page
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))))), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_duration`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`)))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))))), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$prev_pageview_duration`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$prev_pageview_duration`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`)))))), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY breakdown_value) AS time_on_page ON equals(counts.breakdown_value, time_on_page.breakdown_value)
LEFT JOIN
(SELECT breakdown_value AS breakdown_value,
@@ -6480,7 +6480,7 @@
FROM raw_sessions
WHERE and(equals(raw_sessions.team_id, 99999), greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC')), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')), toIntervalDay(3))))
GROUP BY raw_sessions.session_id_v7) AS events__session ON equals(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), events__session.session_id_v7)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS bounce ON equals(counts.breakdown_value, bounce.breakdown_value)
@@ -6543,7 +6543,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-15 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-15 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6585,7 +6585,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6627,7 +6627,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -6669,7 +6669,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_vitals_path_breakdown.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_vitals_path_breakdown.ambr
index 3807fb1a93de..4ae193d8ec9d 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_vitals_path_breakdown.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_vitals_path_breakdown.ambr
@@ -12,7 +12,7 @@
(SELECT replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', '') AS path,
quantile(0.75)(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$web_vitals_INP_value'), ''), 'null'), '^"|"$', ''), 'Float64')) AS value
FROM events
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY path
HAVING ifNull(greaterOrEquals(value, 0), 0)))
ORDER BY value ASC,
@@ -45,7 +45,7 @@
(SELECT replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', '') AS path,
quantile(0.75)(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$web_vitals_INP_value'), ''), 'null'), '^"|"$', ''), 'Float64')) AS value
FROM events
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY path
HAVING ifNull(greaterOrEquals(value, 0), 0)))
ORDER BY value ASC,
@@ -78,7 +78,7 @@
(SELECT replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', '') AS path,
quantile(0.75)(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$web_vitals_INP_value'), ''), 'null'), '^"|"$', ''), 'Float64')) AS value
FROM events
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY path
HAVING ifNull(greaterOrEquals(value, 0), 0)))
ORDER BY value ASC,
@@ -111,7 +111,7 @@
(SELECT replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', '') AS path,
quantile(0.75)(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$web_vitals_LCP_value'), ''), 'null'), '^"|"$', ''), 'Float64')) AS value
FROM events
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY path
HAVING ifNull(greaterOrEquals(value, 0), 0)))
ORDER BY value ASC,
@@ -144,7 +144,7 @@
(SELECT replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', '') AS path,
quantile(0.75)(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$web_vitals_INP_value'), ''), 'null'), '^"|"$', ''), 'Float64')) AS value
FROM events
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY path
HAVING ifNull(greaterOrEquals(value, 0), 0)))
ORDER BY value ASC,
@@ -177,7 +177,7 @@
(SELECT replaceRegexpAll(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', ''), '\\/cleaned\\/\\d+', '/cleaned/<id>') AS path,
quantile(0.75)(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$web_vitals_INP_value'), ''), 'null'), '^"|"$', ''), 'Float64')) AS value
FROM events
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY path
HAVING ifNull(greaterOrEquals(value, 0), 0)))
ORDER BY value ASC,
@@ -210,7 +210,7 @@
(SELECT replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', '') AS path,
quantile(0.75)(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$web_vitals_INP_value'), ''), 'null'), '^"|"$', ''), 'Float64')) AS value
FROM events
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY path
HAVING ifNull(greaterOrEquals(value, 0), 0)))
ORDER BY value ASC,
@@ -243,7 +243,7 @@
(SELECT replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', '') AS path,
quantile(0.9)(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$web_vitals_INP_value'), ''), 'null'), '^"|"$', ''), 'Float64')) AS value
FROM events
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY path
HAVING ifNull(greaterOrEquals(value, 0), 0)))
ORDER BY value ASC,
@@ -276,7 +276,7 @@
(SELECT replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', '') AS path,
quantile(0.99)(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$web_vitals_INP_value'), ''), 'null'), '^"|"$', ''), 'Float64')) AS value
FROM events
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY path
HAVING ifNull(greaterOrEquals(value, 0), 0)))
ORDER BY value ASC,
@@ -309,7 +309,7 @@
(SELECT replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', '') AS path,
quantile(0.75)(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$web_vitals_INP_value'), ''), 'null'), '^"|"$', ''), 'Float64')) AS value
FROM events
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', ''), '/path1'), 0)))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, '$pathname'), ''), 'null'), '^"|"$', ''), '/path1'), 0)))
GROUP BY path
HAVING ifNull(greaterOrEquals(value, 0), 0)))
ORDER BY value ASC,
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_vitals_path_breakdown.new_events_schema.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_vitals_path_breakdown.new_events_schema.ambr
index dfd348f20572..353bc87efc80 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_vitals_path_breakdown.new_events_schema.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_vitals_path_breakdown.new_events_schema.ambr
@@ -12,7 +12,7 @@
(SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))) AS path,
quantile(0.75)(accurateCastOrNull(events.properties.`$web_vitals_INP_value`, 'Float64')) AS value
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY path
HAVING ifNull(greaterOrEquals(value, 0), 0)))
ORDER BY value ASC,
@@ -45,7 +45,7 @@
(SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))) AS path,
quantile(0.75)(accurateCastOrNull(events.properties.`$web_vitals_INP_value`, 'Float64')) AS value
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY path
HAVING ifNull(greaterOrEquals(value, 0), 0)))
ORDER BY value ASC,
@@ -78,7 +78,7 @@
(SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))) AS path,
quantile(0.75)(accurateCastOrNull(events.properties.`$web_vitals_INP_value`, 'Float64')) AS value
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY path
HAVING ifNull(greaterOrEquals(value, 0), 0)))
ORDER BY value ASC,
@@ -111,7 +111,7 @@
(SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))) AS path,
quantile(0.75)(accurateCastOrNull(events.properties.`$web_vitals_LCP_value`, 'Float64')) AS value
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY path
HAVING ifNull(greaterOrEquals(value, 0), 0)))
ORDER BY value ASC,
@@ -144,7 +144,7 @@
(SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))) AS path,
quantile(0.75)(accurateCastOrNull(events.properties.`$web_vitals_INP_value`, 'Float64')) AS value
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY path
HAVING ifNull(greaterOrEquals(value, 0), 0)))
ORDER BY value ASC,
@@ -177,7 +177,7 @@
(SELECT replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '\\/cleaned\\/\\d+', '/cleaned/<id>') AS path,
quantile(0.75)(accurateCastOrNull(events.properties.`$web_vitals_INP_value`, 'Float64')) AS value
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY path
HAVING ifNull(greaterOrEquals(value, 0), 0)))
ORDER BY value ASC,
@@ -210,7 +210,7 @@
(SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))) AS path,
quantile(0.9)(accurateCastOrNull(events.properties.`$web_vitals_INP_value`, 'Float64')) AS value
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY path
HAVING ifNull(greaterOrEquals(value, 0), 0)))
ORDER BY value ASC,
@@ -243,7 +243,7 @@
(SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))) AS path,
quantile(0.99)(accurateCastOrNull(events.properties.`$web_vitals_INP_value`, 'Float64')) AS value
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY path
HAVING ifNull(greaterOrEquals(value, 0), 0)))
ORDER BY value ASC,
@@ -276,7 +276,7 @@
(SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))) AS path,
quantile(0.75)(accurateCastOrNull(events.properties.`$web_vitals_INP_value`, 'Float64')) AS value
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY path
HAVING ifNull(greaterOrEquals(value, 0), 0)))
ORDER BY value ASC,
@@ -309,7 +309,7 @@
(SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))) AS path,
quantile(0.75)(accurateCastOrNull(events.properties.`$web_vitals_INP_value`, 'Float64')) AS value
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '/path1'), 0)))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'DateTime'), concat(ifNull(toString(replaceOne(substring(toString(accurateCastOrNull(events.properties.`$pathname`, 'DateTime64(9, \'UTC\')')), 1, 19), ' ', 'T')), ''), ifNull(toString(substring(toString(events.properties.`$pathname`), 20, 10)), ''), 'Z'), if(or(startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Array'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Map'), startsWith(dynamicType(accurateCast(events.properties.`$pathname`, 'Dynamic')), 'Tuple')), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '/path1'), 0)))
GROUP BY path
HAVING ifNull(greaterOrEquals(value, 0), 0)))
ORDER BY value ASC,