Feature Request: ASOF JOIN support for time-series joins
Hi all,
I'd like to request native support for an ASOF JOIN (as-of join) in Zoho Analytics SQL query tables, similar to DuckDB's ASOF JOIN and pandas' merge_asof().
The problem
When building a time-series by joining two other time-series on a timestamp, the timestamps rarely line up exactly. An ASOF JOIN matches each row in the left table to the closest preceding row in the right table, instead of requiring an exact match.
This is currently possible in Zoho Analytics, but only through workarounds — I've been using window functions and the "gaps and islands" technique. These work, but they're verbose, harder for analysts to read and maintain, and don't scale gracefully. A first-class ASOF JOIN would collapse all of that into a single, self-documenting clause.
Example
Suppose we have an orders table and a stock table. Both are cumulative time-series that generally trend upward but can dip. We want to return one row per order, showing the total order volume and the total stock as they stood at the moment each order was placed:
orders
| ts | total_orders |
|---|---|
| 09:00:05 | 120 |
| 09:00:12 | 138 |
stock
| ts | total_stock |
|---|---|
| 09:00:00 | 500 |
| 09:00:10 | 480 |
Desired output — each order matched to the most recent stock level at or before its timestamp:
| ts | total_orders | total_stock |
|---|---|---|
| 09:00:05 | 120 | 500 |
| 09:00:12 | 138 | 480 |
In DuckDB this is simply:
SELECT o.ts, o.total_orders, s.total_stock
FROM orders o
ASOF JOIN stock s
ON o.ts >= s.tsThe pandas equivalent is merge_asof(orders, stock, on="ts").
Why it matters
We're currently generating this kind of time-series in CRM with Zoho Deluge, writing results to records in a module. We'd like to simplify that by moving the logic into SQL query tables in Zoho Analytics — a system our analysts find easier to understand and maintain. Native ASOF JOIN support would meaningfully increase the viability of Zoho Analytics and SQL as a replacement for our Deluge-based pipeline.
Producing one time-series by joining two on a nearest-timestamp basis is a very common operation in analytics, monitoring, and operational reporting. First-class support would remove real friction and help Zoho Analytics further stand out from the crowd. Last time I checked, not many products include support for ASOF.
Thanks for considering it!