Help with filterFactory.dateRange
I have indicators with a date range filter set up on the Sisense website (see attached image). I am trying to replicate this set up in my UI with the sisense/sdk-data filterFactory.dateRange function, and I am struggling to know how I need to format the dates I pass in to get the same results as the Sisense website. I have tried passing in dates in a "YYYY-MM-DD" format, a "MM/DD/YYYY" format, and a date (new Date()) format. With all of these formats my indicators either return a 0 or N/A value, or values that are way too high (so it seems like the filter is not being applied). What do I need to do differently to get this working? I am trying to filter to show data from the last four weeks.
Â
Â
 <IndicatorChart {...widget.getChartProps()}
        filters={[filterFactory.dateRange(DM.SeasonCalendar.CalendarDate, fourWeeksAgoFormattedDate, todayFormattedDate)]} />
ewoytowitz
Posted 2 years ago·Last reply 2 years ago
2 comments
steve
·2 years agoHi ewoytowitzÂ
Can you try adding .Days to your dimension to select a specific date level? e.g.
DM.SeasonCalendar.CalendarDate.Days
I think then it should work, if you use a date format like yyyy-MM-DD .. for example
Â
ewoytowitz
OP2 years agoThank you! That worked