
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2019 11:53 AM
Hi friends,
I am not a reporting expert. Need help in writing a schedule job for a report to send an email on last friday of every month.
I went to report and then click on schedule, under Run selected monthly and it shows day of the month. Please suggest on how to write a schedule job to send an email on last friday of every month.
Thanks in advance,
Karthik
Solved! Go to Solution.
- Labels:
-
Reporting

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2019 12:48 PM
More details on my solution... Use the script below in your condition:
function isLastWeekOfMonth() {
var report_date = new GlideDateTime();
var days_in_month = report_date.getDaysInMonthUTC();
var day_of_month = report_date.getDayOfMonthUTC();
if (day_of_month >= days_in_month - 6) {
return true;
} else {
return false;
}
}
isLastWeekOfMonth();
More info can be found below:
Scheduled Reports - Condition Script

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2019 11:59 AM
Scheduling reports may impact your performance.
Imaging, you add 100s of reports as scheduled reports and you run them hourly.
Also, scheduled report won't give you dynamic data.
Better idea is to publish this report on dashboard so that users will see dynamic data and give link of dashboard to users.
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2019 12:03 PM
Hi Sachin,
Thanks for your immediate response.
The report already exist in SNOW, all I need is email the report last friday of every month. Any ideas?
Thanks,
Karthik.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2019 12:10 PM
Check this out
Scheduled Job Condition - First Monday of Every Month
you will have to just update scheduled job condition for last friday.
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2019 12:17 PM
Hi Karthik,
Have you tried combining a weekly execution for every Friday and a conditional script to only return true when that Friday happens to be the last Friday in a given month?