BookmarkSubscribeRSS Feed
PavanKumar2
Fluorite | Level 6

Hi team,

 

I am adding another requirement.

 

I have Planned Start Date as 10 th March 2019 and Planned End Date as 21 th March 2019.

current date:20 th March 2019

 

Result I am getting:

Planned Difference in Days - 11 days

Remaining days - 1 day(21 st March 2019 - 20 th March 2019)

 

 

But 10 th march 2019 - sunday and  16 th march 2019 Saturday and 17 th march 2019 sunday. I want to eliminate Weekends.

 

Result I need :

 No of Business Days = 7 days.

Remaining days = 1 day

 

Remaining days vs Planned : (1 day out of (7 days) as sinlge column to display

 

 

Please Help me.

 

Regards,

Pavan.

1 REPLY 1
Arjen
SAS Employee

You could use the INTCK function for this. This allows you to calculate the number of weekdays between two days, like in the following example:

 

diff = intck('WEEKDAY', start_date, end_date)

 

Chris Hemedinger wrote a blog entry with a function that will consider holidays as well. You can find it here:

https://blogs.sas.com/content/sasdummy/2011/05/09/calculating-the-number-of-working-days-between-two...

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 548 views
  • 0 likes
  • 2 in conversation