I want to calculate cycle time -difference between received date and closed date in days which includes only business days
Exclude weekends and public holidays
Using recordtype-new custom record field I wanna to achieve as I need to use in process hq reports
Thanks,
Priyadharshini. S
Discussion posts and replies are publicly visible
CREATE TABLE PUBLIC_HOLIDAYS ( holiday_date DATE, holiday_name VARCHAR2(100) );
Build rule!CALC_BusinessDays(startDate, endDate)
rule!CALC_BusinessDays(startDate, endDate)
rule!CALC_BusinessDays( startDate: recordType!YourRecord.fields.receivedDate, endDate: recordType!YourRecord.fields.closedDate )
Use networkdays(receivedDate, closedDate, cons!PUBLIC_HOLIDAYS) in a sync-time custom record field - this works cleanly in Process HQ reports. For dynamic holidays, maintain the constant by periodically syncing it from your holiday table via a scheduled process.
Function calworkdays() returns the number of net work days between two datetimes excluding weekends and holidays by default. This is supported in Sync Time custom record field as well. So you can configure an expression like below.
fn!calworkdays(rv!record[HS Test.fields.startDate'], rv!record[HS Test.fields.endDate'],"IndiaHolidayCalendar")
The last parameter takes in a 'calendar_name' which can be created using 'Process Calendar' in Designer->Objects view. It is an optional parameter. If you don't have a process calendar then system calendar is the default value which is used as 'calendar_name'.
Since sync-time custom record filed dont support constants use the process calendar name as string (e.g. IndiaHolidayCalendar). Hope it helps.