You can use differenceBetweenDays in BusinessCalendar, which takes 4 parameters. If you supply 'true' as value for useBusinessCalendar(boolean parameter), it will take Data-Admin-Calendar instance (There is one more function that looks similar differenceBetweenDates, which is retired/deprecated). If you have questions about what Calendar will be applied at run time, let me know (Because calendar instance can be referenced in multiple places).
That will not work in report definition. We need write custom function alias rule in Embed-UserFunction class and PEGA will not allow to write normal java code when writing Java code in function alias rule in this class. it only accepts SQL script, for more information please differenceindays function alias rule.
Please let us know if there is any solution to calculate age excluding business days in the report definition.
Approaches Tried from my end-
1) Created a DE on property AGE and referred in Report definition. Called this report definition in UI by using repeating grid. Age is calculated by excluding holidays but sort and filtering is not working. Raised an SR A7312 regarding this and they asked to use functions in report definition and upon raising the concern that it is not excluding business days then PEGA GCS team asked to raise an SR for excluding business team.
2) Added function in RD but it is not excluding business days, tried to reuse the function code of DifferenceBetweenDays but to function alias in RP then that rule should be in Embed-Userfunction class. Function alias rule in this class accepts only SQL format code. Tried with some other approaches to create a function alias rule but couldn't succeed.
Hello Vinay, Did you get any response on this "use functions in report definition and upon raising the concern that it is not excluding business days then PEGA GCS team asked to raise an SR for excluding business team." regard. Please let me know if this issue has been resolved as I too having the same issue as you mentioned. Thanks in advance!!
Hi All, I am also checking for the solution for the highlighted scenario. We had raised the support request((SR-B94956), but we were requested to check for the solution in the Product Support community. If the Pega GCS team could relook on the scenario, it will be really helpful for the display of the statistics in the report (i.e. difference between the datetime including the business Calendar).
Thank you for posting your query in the PSC. This looks like an inactive post and hence, we suggest you create a new post for your query. Click on the Write a Post button that’s available on the top right pane of this page. Once created, please reply back here with the URL of the new post.
You may also refer this discussion link as a reference in the new thread.