Skip to content

Commit 3b116a2

Browse files
authored
Including customerid, experiment filters directly in the base SQL query (dotCMS#32556)
### Proposed Changes * Including customer's id, cluster's id and experiment query directly in the CubeJS base query
1 parent 96213ca commit 3b116a2

File tree

1 file changed

+4
-1
lines changed
  • docker/docker-compose-examples/analytics/setup/config/dev/cube/schema

1 file changed

+4
-1
lines changed

docker/docker-compose-examples/analytics/setup/config/dev/cube/schema/Events.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ cube(`Events`, {
1616
COUNT(CASE WHEN event_type = 'pageview' THEN 1 ELSE 0 END) AS pageviews,
1717
SUM(CASE WHEN (E.isexperimentpage = true AND C.maxDate = E.utc_time AND event_type = 'pageview') THEN 1 ELSE 0 END) as experimentPageLastVisited
1818
FROM events E JOIN CountsAndLastURL C ON C.lookbackwindow = E.lookbackwindow
19-
WHERE event_type = 'pageview'
19+
WHERE ${FILTER_PARAMS.request.customerId.filter('customer_id')}
20+
AND ${FILTER_PARAMS.request.cluster_id ? FILTER_PARAMS.request.cluster_id.filter('cluster_id') : '(cluster_id IS NULL OR cluster_id = \'\')'}
21+
AND ${FILTER_PARAMS.request.experiment.filter('experiment')}
22+
AND event_type = 'pageview'
2023
GROUP BY experiment, runningid, lookbackwindow, variant, day
2124
having isSession = 1
2225
order by day

0 commit comments

Comments
 (0)