0

Is it possible to write dynamic date range formula in NetSuite Saved Search? For example I have one of the expression in results tab is | case when {type} = 'Sales Order' and {custbody6} = 'F' then {amount} else 0 end | and I want to be able to add the dynamic date range to this like, and when {date} or {datecreated} is within 'last week' or 'last month' etc....

Imran
  • 93
  • 2
  • 15

1 Answers1

2

There are many search date filters, such as thisWeek, lastWeek, etc. You can find them listed in NS help, under Search Date Filters. The filters are supported in formulas also.

ehcanadian
  • 1,738
  • 1
  • 15
  • 23
  • What I need is guidance on how would I re-write my above existing (expression) with one of the dynamic date range filters that are available in NetSuite...such as 'last week'? – Imran Nov 09 '18 at 19:55
  • In the UI, select `Formula (Date)` and you'll see the available filters. – ehcanadian Nov 11 '18 at 21:15
  • If I set the date on entire search, then other data on this saved search will also be effected. I have other formula lines on this saved search on which I don't want date filter to apply, therefore this needs to be written as part of case statement. – Imran Nov 12 '18 at 18:25
  • 1
    In that case, you'll need to do something like; `case when {today} - {datecreated} <= 90 then 1 else 0 end`. 90 being the days. – ehcanadian Nov 12 '18 at 21:30
  • Thanks! It Worked great! – Imran Nov 13 '18 at 21:03