How to calculate number of minutes of a month
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2019 05:40 AM
Hi,
I would like an indicator that shows how many business minutes there is in a month. I have a schedule and by using that I want it to calculate the minutes so I can show it in an indicator.
I have one indicator that calculates the minutes an incident has been open (business hours) but I need another indicator to divide it by the total business minutes in the month. Can I do this directly in an indicator, or do I need to create a table to hold the data?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2019 04:50 AM
You can use duration calculator
Here is an example script
var dc = new DurationCalculator();
dc.setSchedule('08fcd0830a0a0b2600079f56b1adb9ae'); // Schedule sys_id. Naavigate to System Scheduler > Schedules
var dur = dc.calcScheduleDuration(start, end); // Update start and end variables
var business_days = dur/(60*60*9); // If you are using 8AM - 5PM schedule use 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2019 05:44 AM
Not sure I can use that one. On what table should I use it? If I point it to the schedule table there is not really a start and end field..