Question


Infosys
US
Last activity: 4 Oct 2018 11:08 EDT
How to calculate business days difference in Report definitaion
I need to display the records age (here age is Bussines days difference between CreateDateTime and CurrentDate )
Please let us know how to write function alias rule for calculating age by excluding business days by using Pega business calander.
Regards,
Vinay
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!


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).


Pegasystems
IN
This wouldn't work at the SQL level. You will need to write your own SQL function to do what we do in R-U-F for Report Definition. Alternatively, you can post process the results by calling the R-U-F.


Infosys
US
Yeah I tried different approaches by using the Java code but couldn't succeed. I asked many PEGA experts and even raised an SR but still couldn't find the solution.
Please let us know the code that need to be written in function alias rule.
Many Thanks..!!
Regards,
Vinay


Pegasystems
US
Govardhan's suggestion in reply Re: How to calculate business days difference in Report definitaion looks good. Did that work for you ? If not, what was the error ? Thanks. /Eric


Infosys
US
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.
Many thanks..!!
Regards,
Vinay


Infosys
US
Hi,
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.
Many Thanks,
Vinay


Cognizant
US
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!!


Tata Consultancy Services Ltd
AU
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).
Any suggestions?


Pegasystems Inc.
IN
Hello!
I see that you created new posts for your queries. That's a good practice!
Regards,


OCBC Bank
SG
Hi All, I am also checking for the solution for this scenario.
Any suggestions ?


Pegasystems Inc.
IN
Hi,
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.