Question

5
Replies
225
Views
NandiniT8798 Member since 2019 1 post
Ruletronics
Posted: 9 months ago
Last activity: 3 weeks 5 days ago

Business days calculation using Function alias in Report definition

Hi,

We have a requirement to display business days in a report definition.

we need to calculate the age as difference in business days. If the target date was Friday 4th Oct, if we run the function today we need to get the age as 10 as we need to exclude the weekends which are not business days.

Function BusinessCalendar is not supporting in RD. I had gone through PDN and Mesh, some posts are like creating DE for a property using BusinessCalander function. So that we can use that property. But in our requirement without property, we need to apply businessdays calculation to the required columns. I tried to create Function Alias rule, but some where I missed some logic. It’s not working for some scenarios.

Below is the logic of function :{2} -Is the calendar days(difference of days between Target data and Today)

CASE

WHEN {2}>=6 THEN {2}-(({2}/7)*2)

WHEN {2}>=0 AND {2}<6 THEN {2}

WHEN {2}>=0 AND {2}<6 AND DATENAME(weekday,{1}) = 'Sunday' OR DATENAME(weekday,GETDATE()) = 'Saturday' THEN {2}-1

WHEN {2}<0 THEN {2}+(({2}/7)*2)

END

Any one have function alias logic to get business days, please help me to solve the issue.

Thank you,

***Moderator Edit-Vidyaranjan: Updated Platform Capability***

User Interface
Share this page LinkedIn