sisense.com
✅ You are viewing documentation for the latest version of Compose SDK.
Version:

Function dateTo

dateTo( level, to, config?): Filter

Creates a filter that keeps rows on or before an end date at the given level, with no lower limit.

Parameters

ParameterTypeDescription
levelLevelAttributeDate LevelAttribute to filter on
toDate | stringDate or ISO-format string
config?BaseFilterConfigOptional configuration for the filter

Returns

Filter

A filter instance

Remarks

Pass a JavaScript Date or an ISO-format datetime string. On YearsDays levels, the time part (from the first T onward) is stripped.

Example

Filter for items where the date is from the year 2010 or earlier in the Sample ECommerce data model.

filterFactory.dateTo(DM.Commerce.Date.Years, '2010-01-01')
// or
filterFactory.dateTo(DM.Commerce.Date.Years, '2010-12-31')

With Years as date level, both are equivalent: the level uses the calendar year only, so month and day inside that year do not change the filter.

Last Updated: