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

# newRelativeDashboardDateFilter()

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

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Creates a new relative dashboard date filter.

**Signature:**

```typescript
export declare function newRelativeDashboardDateFilter(granularity: DateFilterGranularity, from: number, to: number, dataSet?: ObjRef, localIdentifier?: string, boundedFilter?: IUpperBoundedFilter | ILowerBoundedFilter, emptyValueHandling?: EmptyValues): IDashboardDateFilter;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| granularity | [DateFilterGranularity](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.datefiltergranularity/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 |
| dataSet | [ObjRef](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.objref/index.md) | _(Optional)_ |
| localIdentifier | string | _(Optional)_ |
| 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)_ |
| emptyValueHandling | [EmptyValues](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.emptyvalues/index.md) | _(Optional)_ |

**Returns:**

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