JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Skip to content
Gallery
Product
Sprint Backlog
Roadmap
PRDs
Shared PRDs
Release Plans
New Markets
Campaign Playbook
Personas
Product Offerings
OKRs
Queries
Archive
Meeting Notes
Miami Kickoff
Customer Profile
Updated Onboarding Tutorial
LA Metro
More
Share
Explore
Queries
Segment by trips
UserIDs in segment
replace count with the definition of the segment
SELECT
"UserID",
COUNT(*) AS "ActivatedTicketCount"
FROM
"Behaviours"
WHERE
"ActivatedAtUTC" BETWEEN '2024-01-31' AND '2024-02-28'
GROUP BY
"UserID"
HAVING
COUNT(*) > 19;
Count of users in segment
replace count with the definition of the segment
SELECT
COUNT(*) AS "NumberOfUsers"
FROM (
SELECT
"b"."UserID"
FROM
"Behaviours" "b"
JOIN
"UsersFromTenants" "u" ON "b"."UserID" = "u"."UserID"
WHERE
"b"."ActivatedAtUTC" BETWEEN '2024-03-27' AND '2024-04-24'
AND "u"."ConsentedAtUTC" IS NOT NULL
GROUP BY
"b"."UserID"
HAVING
COUNT(*) BETWEEN 1 AND 2
) AS SubQuery;
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.