Count DISTINCT events across a rollup's owners

Featurekamo-shared-library
Shipped
August 26, 2026 at 3:52 AM UTC
Author
Kamo
Commit
22014ee

A phone number can be a contact point on more than one owner at once, and two leads on one account sharing one is the ORDINARY case — they are commonly the same person enquiring twice. The matcher writes a row per owner deliberately, because each of those timelines needs its own. Summed over a rollup, plain counts report one call as two, and a rail reading 11 above a list showing 6 is worse than no rail at all. COUNT(DISTINCT sourceId) over a list of owners of one kind counts exactly what the merged timeline shows, and it turns an account's 26 count queries into two.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing