cancel
Showing results for 
Search instead for 
Did you mean: 

Help with filterFactory.dateRange

ewoytowitz
8 - Cloud Apps
8 - Cloud Apps

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)]} />
1 ACCEPTED SOLUTION

steve
Sisense Team Member
Sisense Team Member

Hi @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

 

filters: [filterFactory.dateRange(Ecom.Commerce.Date.Days, '2013-04-01', '2013-04-28')]
 
Hope that helps!
Steve

View solution in original post

2 REPLIES 2

steve
Sisense Team Member
Sisense Team Member

Hi @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

 

filters: [filterFactory.dateRange(Ecom.Commerce.Date.Days, '2013-04-01', '2013-04-28')]
 
Hope that helps!
Steve

Thank you! That worked