Skip to main content
May 15, 2026
Question

To calculate cycle time

  • May 15, 2026
  • 3 replies
  • 0 views

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

    3 replies

    subhankarb6682
    May 15, 2026

    Step 1 — Create a Holiday Table in DB

    sql
    CREATE TABLE PUBLIC_HOLIDAYS (
      holiday_date DATE,
      holiday_name VARCHAR2(100)
    );

    Step 2 — Create an Expression Rule

    Build rule!CALC_BusinessDays(startDate, endDate)

    Step 3 — Custom Record Field

    rule!CALC_BusinessDays( startDate: recordType!YourRecord.fields.receivedDate, endDate: recordType!YourRecord.fields.closedDate )

     
    shubhama926776
    May 15, 2026

    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.

    harshas2775
    May 15, 2026

    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.