Date

In the GROUP BY operator, the Date partitioning function allows you to create date-based partitions.

See Also
GROUP BY
Expression Language
Defining Data Queries
Parameter Description
Enable year field Creates partitions by year. Default value: true.
Enable quarter field Creates partitions by quarter (from 1 to 4). Default value: false.
Enable month field Creates partitions by month (from 1 to 12). Default value: true.
Enable day field Creates partitions by month day (from 1 to 31). Default value: true.
Enable week year field Creates partitions by week according to ISO. Unlike Enable week field, it keeps 7 days per week. Default value: false.
Enable week field Creates partitions by week (from 1 to 53). Be careful, with this mode, the first and last weeks of the year can have less than 7 days. Default value: false.
Enable week day field Creates partitions by weekday (from 1 to 7). Default value: false.
Enable hour field Creates partitions by hour. Default value: false.
Enable minute field Creates partitions by minute. Default value: false.
Enable second field Creates partitions by second. Default value: false.
Max groups Use this parameter to define an expression returning an integer, which corresponds to the maximum number of groups that you want to get in output.

The number of groups depends on the fields (year, month, day...) enabled using the previous parameters. For example, if you have two YYYY-MM-dd dates, 2026-01-01 and 2026-02-01:

  • If you aggregate by year, you get only one 2026 group in output.
  • If you aggregate by year and month, you get two groups in output, 2026-01 and 2026-02.

When you define a Max groups parameter, the date function begins by aggregating all the fields that you enabled. If there are more groups in output than the number defined in Max groups, it disables fields from the most precise to the less precise. It starts by clearing Enable second field, and if there are still too many groups, it clears Enable minute field, etc., until you get fewer groups in output than the value defined in Max groups.

If there are 3 dates, 2026-01-01, 2026-02-01, and 2026-03-01, and you decide to aggregate by months, you get 3 groups in output: 2026-01-01, 2026-02-01, and 2026-03-01. If you set Max groups to 3, you get the same result, but if you set it to 2, there are too many groups so the function disables the month field and the output returns only the year group 2026.

Fill gaps Adds empty partitions to keep a continuous partition sequence. Default value: false.