Skip to content

Commit f9ff494

Browse files
committed
docs: Add docs for beforeOrOnDate and afterOrOnDate operators. Fixes #9661
1 parent dd7d234 commit f9ff494

File tree

1 file changed

+60
-8
lines changed

1 file changed

+60
-8
lines changed

docs/pages/product/apis-integrations/rest-api/query-format.mdx

Lines changed: 60 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,9 @@ use [timeDimensions](#time-dimensions-format) `dateRange` instead.
370370
</WarningBox>
371371

372372
The operator `inDateRange` is used to filter a time dimension into a specific
373-
date range. The values must be an array of dates with the following format
374-
'YYYY-MM-DD'. If only one date specified the filter would be set exactly to this
375-
date.
373+
date range. The values must be an array of timestamps in the [ISO 8601][wiki-iso-8601]
374+
format, for example `2025-01-02` or `2025-01-02T03:04:05.067Z`. If only one timestamp
375+
is specified, the filter would be set exactly to this timestamp.
376376

377377
There is a convenient way to use date filters with grouping -
378378
[learn more about the `timeDimensions` property here](#time-dimensions-format)
@@ -400,7 +400,7 @@ is just missing the filtered time dimension in
400400
</WarningBox>
401401

402402
An opposite operator to `inDateRange`, use it when you want to exclude specific
403-
dates. The values format is the same as for `inDateRange`.
403+
timestamps. The values must be in the same format as for [`inDateRange`](#indaterange).
404404

405405
- Dimension types: `time`.
406406

@@ -424,8 +424,8 @@ just missing the filtered time dimension in
424424

425425
</WarningBox>
426426

427-
Use it when you want to retrieve all results before some specific date. The
428-
values should be an array of one element in `YYYY-MM-DD` format.
427+
Use it when you want to retrieve all results before some specific timestamp. The
428+
values should be an array of one element in the same format as for [`inDateRange`](#indaterange).
429429

430430
- Dimension types: `time`.
431431

@@ -437,6 +437,31 @@ values should be an array of one element in `YYYY-MM-DD` format.
437437
}
438438
```
439439

440+
### `beforeOrOnDate`
441+
442+
<WarningBox>
443+
444+
From a pre-aggregation standpoint, `beforeOrOnDate` filter is applied as a generic
445+
filter. All pre-aggregation granularity matching rules aren't applied in this
446+
case. It feels like pre-aggregation isn't matched. However, pre-aggregation is
447+
just missing the filtered time dimension in
448+
[dimensions][ref-schema-ref-preaggs-dimensions] list.
449+
450+
</WarningBox>
451+
452+
Use it when you want to retrieve all results before or on a specific timestamp. The
453+
values should be an array of one element in the same format as for [`inDateRange`](#indaterange).
454+
455+
- Dimension types: `time`.
456+
457+
```json
458+
{
459+
"member": "posts.time",
460+
"operator": "beforeOrOnDate",
461+
"values": ["2015-01-01"]
462+
}
463+
```
464+
440465
### `afterDate`
441466

442467
<WarningBox>
@@ -449,7 +474,8 @@ just missing the filtered time dimension in
449474

450475
</WarningBox>
451476

452-
The same as `beforeDate`, but is used to get all results after a specific date.
477+
The same as `beforeDate`, but is used to get all results after a specific timestamp.
478+
The values should be an array of one element in the same format as for [`inDateRange`](#indaterange).
453479

454480
- Dimension types: `time`.
455481

@@ -461,6 +487,31 @@ The same as `beforeDate`, but is used to get all results after a specific date.
461487
}
462488
```
463489

490+
### `afterOrOnDate`
491+
492+
<WarningBox>
493+
494+
From a pre-aggregation standpoint, `afterOrOnDate` filter is applied as a generic
495+
filter. All pre-aggregation granularity matching rules aren't applied in this
496+
case. It feels like pre-aggregation isn't matched. However, pre-aggregation is
497+
just missing the filtered time dimension in
498+
[dimensions][ref-schema-ref-preaggs-dimensions] list.
499+
500+
</WarningBox>
501+
502+
The same as `beforeOrOnDate`, but is used to get all results after or on a specific timestamp.
503+
The values should be an array of one element in the same format as for [`inDateRange`](#indaterange).
504+
505+
- Dimension types: `time`.
506+
507+
```json
508+
{
509+
"member": "posts.time",
510+
"operator": "afterOrOnDate",
511+
"values": ["2015-01-01"]
512+
}
513+
```
514+
464515
### `measureFilter`
465516

466517
The `measureFilter` operator is used to apply an existing measure's filters to
@@ -629,4 +680,5 @@ refer to its documentation for more examples.
629680
[ref-ungrouped-query]: /product/apis-integrations/queries#ungrouped-query
630681
[ref-default-order]: /product/apis-integrations/queries#order
631682
[ref-default-granularities]: /product/data-modeling/concepts#time-dimensions
632-
[ref-custom-granularities]: /product/data-modeling/reference/dimensions#granularities
683+
[ref-custom-granularities]: /product/data-modeling/reference/dimensions#granularities
684+
[wiki-iso-8601]: https://en.wikipedia.org/wiki/ISO_8601

0 commit comments

Comments
 (0)