Dates and dynamic dates#
A date dimension is narrowed down with fixed dates (“from January 1 to March 31, 2026”), with dynamic dates that are recalculated by themselves each time the document is calculated (“the last 12 months”) or by comparing only one part of the date (“the month is equal to 12”).
Before you start#
Open the segmentation and choose a dimension of type Date in the tree (see The segmentation editor). Its conditions are rows, like those of a numeric dimension, and are added with Add condition. The first condition of a date proposes today's date.
The operators of a date#
A date accepts the same operators as a number except masks and lists: is equal to, is not equal to, is greater than, is less than, is greater than or equal to, is less than or equal to, is between, is not between, has no value and has a value.
Each row has a single value (or its ranges, with is between). For several individual dates, add one row per date: the positive rows are joined with “or”.
Fixed and dynamic dates#
In the Edit conditions dialog, each value of a date has a drop-down list with its type in front of it:
| Type | What it is |
|---|---|
| Static | A fixed date, chosen in the calendar. |
| start of the year, start of the half-year, start of the quarter, start of the month, start of the week, start of the day | The beginning of the period in which the day the document is calculated falls. |
| Now | The moment the document is calculated. |
| end of the year, end of the half-year, end of the quarter, end of the month, end of the week, end of the day | The end of that period. |
A dynamic date also has an Increment or decrement and its Unit (years, months, weeks, days, hours, minutes or seconds). This is how you write “start of the month − 12 months” or “end of the year − 1 year”.
The with hours checkbox makes the value also carry the time. In a static date, the calendar then asks for the date and the time. In a dynamic one, without with hours the value stays on the day, at 00:00 (also an end of period: “end of the month” is the last day of the month at 00:00); with with hours, it carries the exact time.
Tip
If the date column also stores the time, check with hours in the ends of period. Without it, “is less than or equal to end of the month” leaves out the records of the last day that have a time after 00:00.
Examples#
| What you want | Operator | Values |
|---|---|---|
| The last 12 complete months and the current one | is greater than or equal to | start of the month, −12 months |
| The whole of last year | is between | From: start of the year, −1 year. To: end of the year, −1 year |
| The whole previous month | is between | From: start of the month, −1 month. To: end of the month, −1 month |
| The last 30 days, with the time | is greater than or equal to | Now, −30 days, with hours |
In the demo, the workbook “Ventas por zona” has the segmentation “Año pasado, sin anuladas” and the workbook “Productos y márgenes”, the segmentation “Últimos 12 meses”, with conditions like these.
How they are calculated#
- Dynamic dates are resolved with the date and time of the server at the moment the document is calculated. A document that keeps data is recalculated when its scheduling says so or when you process it.
- A start of period is at 00:00 of its first day; an end, with with hours, the last instant of its last day.
- Adding or subtracting months to a last day of the month gives the last day of the target month. For example, “end of the month − 1 month” calculated in April is March 31, and calculated in March it is February 28 (or 29).
In the text of the condition, a fixed date is shown as 03/31/2026 and a dynamic one in words: “start of the month − 12 months”, “now − 30 days (with time)”.
Compare a part of the date#
The Compare field of the dialog chooses what is compared:
| Option | What you type |
|---|---|
| the date | The whole date, static or dynamic. |
| the year | A year: 2025. |
| the half-year | 1 or 2. |
| the quarter | From 1 to 4. |
| the month | From 1 to 12. |
| the week | The ISO year and week: 202641 or 2026-W41 (week 41 of 2026). |
When comparing a part, the values are numbers and there are no dynamic dates. “the month is equal to 12” keeps the records of December of any year; for a month of a specific year, compare the whole date.
If the rows of a date compare different parts, each one says so in its text: “Fecha de factura: the year is equal to 2025 or the month is equal to 12”. If they all compare the same one, the part is said once: “Fecha de factura (month) is equal to 1 or is equal to 12”.
A value outside its interval is rejected (“'13' is not a valid value of month (1 to 12)”).
Date ranges#
With is between, Add range proposes the next period: after a whole month, the next month; after a quarter, the next quarter; after some days, the same number of days that follow. From and To are both included.
A reversed range is not accepted. To see the results spread across those ranges, use Create grouping with these ranges… (see Grouping from documents and the segmentation). That button is not available with dynamic dates or when comparing a part of the date, and it says so next to it.