Skip to content

Conversation

@46bit
Copy link
Contributor

@46bit 46bit commented Oct 27, 2025

Summary

Document new SQL functions additions to Workers Analytics Engine's SQL API:

  • countIf
  • sumIf
  • avgIf
  • toYear
  • toMonth
  • toDayOfMonth
  • toDayOfWeek
  • toHour
  • toMinute
  • toSecond
  • toStartOfYear
  • toStartOfMonth
  • toStartOfWeek
  • toStartOfDay
  • toStartOfHour
  • toStartOfFifteenMinutes
  • toStartOfTenMinutes
  • toStartOfFiveMinutes
  • toStartOfMinute
  • today
  • toYYYYMM

Pre-release

  • countIf, sumIf, avgIf are already live
  • the date/time additions are pending

Documentation checklist

@46bit 46bit requested review from a team, elithrar and irvinebroque as code owners October 27, 2025 18:49
@github-actions github-actions bot added October 2025 product:analytics Related to Analytics product labels Oct 27, 2025
@46bit 46bit changed the title [WIP] Document aggregate-if and date/time function additions to the SQL API for Analytics [WIP] DS-15647 DS-15648: Document aggregate-if and date/time function additions to the SQL API for Analytics Oct 27, 2025
@irvinebroque
Copy link
Contributor

Nice one! Want to make a changelog? See #26069 as reference

@46bit 46bit force-pushed the miki/sql-api-for-analytics-date-time-functions branch from b1410dd to e26eaeb Compare October 29, 2025 12:45
@46bit 46bit requested a review from a team as a code owner November 11, 2025 18:56
…ions to the WAE SQL API

This commit adds the following function additions to the docs:

- `countIf`
- `sumIf`
- `avgIf`
- `toYear`
- `toMonth`
- `toDayOfMonth`
- `toHour`
- `toMinute`
- `toSecond`
- `toStartOfYear`
- `toStartOfMonth`
- `toStartOfDay`
- `toStartOfHour`
- `toStartOfFifteenMinutes`
- `toStartOfMinute`
- `today`

This commit reorders the date/time docs page to be in approximate alphabetical
order, which works much better than just appending the functions to the end.
…L API

These are some assorted functions commonly used by LLMs:

  - `toDayOfWeek`
  - `toStartOfWeek`
  - `toStartOfTenMinutes`
  - `toStartOfFiveMinutes`
  - `toYYYYMM`
This commit adds a changelog entry for recent function additions,
as documented in the previous commits.

I have chosen to omit descriptions of the date/time functions,
because they are all quite generic and it looks unwieldy to have
some many samey descriptions.
@46bit 46bit force-pushed the miki/sql-api-for-analytics-date-time-functions branch from 14f442c to 7e4515c Compare November 11, 2025 18:56
@46bit 46bit changed the title [WIP] DS-15647 DS-15648: Document aggregate-if and date/time function additions to the SQL API for Analytics DS-15647 DS-15648: Document aggregate-if and date/time function additions to the SQL API for Analytics Nov 11, 2025
Copy link
Contributor

@irvinebroque irvinebroque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!!! Thank you!!!

…her-sql-enhancements.mdx

Co-authored-by: Brendan Irvine-Broque <[email protected]>
@46bit 46bit changed the title DS-15647 DS-15648: Document aggregate-if and date/time function additions to the SQL API for Analytics DS-15647 DS-15648: Document aggregate-if and date/time function additions to the WAE SQL API Nov 11, 2025
@rianvdm rianvdm enabled auto-merge (squash) November 12, 2025 00:55
@rianvdm rianvdm merged commit 1244afe into cloudflare:production Nov 12, 2025
2 checks passed
@workers-devprod workers-devprod added the contribution [Holopin] Recognizes a docs contribution, big or small label Nov 12, 2025
@46bit 46bit deleted the miki/sql-api-for-analytics-date-time-functions branch November 12, 2025 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution [Holopin] Recognizes a docs contribution, big or small October 2025 product:analytics Related to Analytics product size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants