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

Function dateRelativeTo

dateRelativeTo( level, offset, count, anchor?, config?): Filter

Creates a filter to isolate items with a date dimension value within a specified range before a given date and level.

Parameters

ParameterTypeDescription
levelLevelAttributeDate LevelAttribute to filter on
offsetnumberNumber of levels to skip from the given anchor or the default of the current day (e.g. 6 is 6 months when level is a months level attribute)
countnumberNumber of levels to include in the filter (e.g. 6 is 6 months when level is a months level attribute)
anchor?Date | stringDate to filter to, defaults to the current day
config?BaseFilterConfigOptional configuration for the filter

Returns

Filter

A filter instance

Example

Filter for items in the Sample ECommerce data model where the date is in the first half of 2010 or in 2011.

filterFactory.dateRelativeTo(DM.Commerce.Date.Months, 0, 18, '2011-12'),
Last Updated: