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

Function dateFrom

dateFrom( level, from, config?): Filter

Creates a filter to isolate date values starting from and including the given date and level.

Parameters

ParameterTypeDescription
levelLevelAttributeDate LevelAttribute to filter on
fromDate | 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 in the Sample ECommerce data model where the date is not before the year 2010.

filterFactory.dateFrom(DM.Commerce.Date.Years, '2010-01-01')
// or
filterFactory.dateFrom(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: