> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# newRelativeDateFilter()

- Package: [@gooddata/sdk-model](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/index.md)
- Kind: function
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-model/src/execution/filter/factory.ts

Creates a new relative date filter.

**Signature:**

```typescript
export declare function newRelativeDateFilter(dateDataSet: ObjRef | Identifier, granularity: DateAttributeGranularity, from: number, to: number, localIdentifier?: string, boundedFilter?: IUpperBoundedFilter | ILowerBoundedFilter, emptyValueHandling?: EmptyValues): IRelativeDateFilter;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| dateDataSet | [ObjRef](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.objref/index.md) \| [Identifier](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.identifier/index.md) | ref or identifier of the date data set to filter on |
| granularity | [DateAttributeGranularity](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.dateattributegranularity/index.md) | granularity of the filters (month, year, etc.) |
| from | number | start of the interval – negative numbers mean the past, zero means today, positive numbers mean the future |
| to | number | end of the interval – negative numbers mean the past, zero means today, positive numbers mean the future |
| localIdentifier | string | _(Optional)_ filter local identifier See also [DateAttributeGranularity](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.dateattributegranularity/index.md) and [DateGranularity](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.dategranularity/index.md) |
| boundedFilter | [IUpperBoundedFilter](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iupperboundedfilter/index.md) \| [ILowerBoundedFilter](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.ilowerboundedfilter/index.md) | _(Optional)_ optional bounded filter to use in the filter |
| emptyValueHandling | [EmptyValues](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.emptyvalues/index.md) | _(Optional)_ |

**Returns:**

[IRelativeDateFilter](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.irelativedatefilter/index.md)
