Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Not able to calculate Business days in report Definition



User requires to know on how to generate reports based on BUSINESS Days open report definition.

Error Messages

Not Applicable

Steps to Reproduce

1. Create instance of Business Calendar.
2. Create report definition and try to calculate the with below logic
age: Cases <= 1 business day; Cases >1<=3 business days; Cases >3 business days

Root Cause

This issue was determined to be a product enhancement request.


The issue is how to determine which days are part of the weekend or a holiday at an SQL level.

While the weekends may be universal the holidays will vary by locale and business.

In the actual SQL see that the DifferenceInDays function that is being used by the report is simply doing a subtraction of the two dates entered.

It is not taking into accounts weekends or holidays.


An SQL function will need to be created to do what is required.

To do this store the holidays in a database table.

The table may need to include weekends as well but depending on the database there may be some database built in functions which could be leverage.

Then the custom SQL function would just be querying this table for the number of non-business dates which fall between two dates.

NonBusinessDays table content with both holidays and weekends:

1/1/17 (Sunday)
1/2/17 (assuming this was New Year's Holiday)
1/16/17 (MLK holiday)
and so on

In the report to get the number of business days between date1 and date2 add an equation to calculate DifferenceInDays (date1, date2) - NonBusinessDays(date1, date2).

There would be a little work in populating the NonBusinessDays table for each years of dates but maybe write an activity to do that based upon the business calander.

An enhancement request, FDBK-19293, has been created for consideration by Pega Product Management.

Published September 6, 2017 - Updated October 8, 2020

Was this useful?

100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us