Custom date range in Change list report - this Friday to next Friday relative to today?

kkilroy
Kilo Contributor

I would like to create a list report of Changes as a gauge on a homepage. Our change week is Friday @ 20:00 through the following Friday @ 19:59 US Eastern. I'd like to be able to create a report with a range relative to today to show upcoming changes for the current change week and another report for changes in the next change week.

This is how I'd determine the start and end (same equation + 7) in Excel:

=(6-WEEKDAY(TODAY())+TODAY())

Day of week you want (Sun=1...Sat=7) minus whatever day of week today is then add that many days to today's date. I do similar to determine what last Friday was (same equation - 7).


but I'm not sure how or if I can do this in servicenow.


Thanks in advance for assistance.


Kevin

9 REPLIES 9

Hi gcollins,

I am facing the same requirement. Could you please share the implementation that you got for the same, if it worked for you.

Thanks!

nm13
Kilo Guru

Solved

 

I have a basic report that displays all he change tasks open in the change week (Wed to Tue). If today is Monday, the change tasks from previous Wednesday to this Tuesday should be seen. If today is Friday, the change tasks from this week's Wednesday to coming Tuesday should be seen.

My custom dates are from Wednesday to Next Tuesday, relative today. You can modify according to your dates. Please find the attached Script Include.

Script Include: Attached 

In the report condition, you have the condition as 'Number' is one of: javascript: new ChangeDynamicNawshi().testChangeWeek();

 

Carpe Diem!

Purushothama Ra
Kilo Contributor

Hi Kevin,

 

Try the below filters to get the records with the Planned Start Date between Friday of Previous Week to Thursday of Current Week.

  • Planned Start Date -> at or after -> Last 7 days
  • Planned Start Date -> trend -> on or after -> Friday

 

Hope this helps...

Regards,

Raju

 

 

 

Hi Raju

 

Can you please guide with the use of trend filter.

 

My requirement is to fetch a report for 4 consecutive days(fri,sat,sun.mon) only. please guide . what filter condition needs to be used here .

 

noorulainatta21
Tera Contributor

Hi @Annie11 ,
Frinday - Monday are not consecutive days. It works from Sunday to Saturday. I have created the report for Monday to Thursday below and it's working perfectly fine.

noorulainatta21_0-1717189007863.png
But if you give Friday to Monday, I won't work. You can give days one by one as below or can make two conditions (as "on or after sunday to on or before Monday" and "on or after frinday to on or before sunday") better and easy to go with separate days.

noorulainatta21_1-1717189881904.png

 

I hope you will find the answer. Thumbs up if It helps you.
Thank you,