BookmarkSubscribeRSS Feed
LenHarbottle
Fluorite | Level 6
When trying to use the interval function (intnx) to calculate the dates for the Monday of the previous 4 weeks based upon todays date, I am being returned a spureous date for week3.

Select Data:

Today = today()
Week1 = INTNX('week1.2',today(),0)
Week2 = INTNX('week2.2',today(),0)
Week3 = INTNX('week3.2',today(),0)
Week4 = INTNX('week4.2',today(),0)

Output:

Today = 02/06/2010
Week1 = 31/05/2010
Week2 = 24/05/2010
Week3 = 31/05/2010 (should be 17/05/2010)
Week4 = 10/05/2010

Any ideas?

Regards

Len Harbottle
1 REPLY 1
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Suggest you review the SAS INTNX DOC on how you want to use the INTNX function with the WEEK value and a "multiple" *AND* and a "shift-index". Possibly you want to be incrementing (actually it would be decrementing) argument #3 instead for a prior period start date? Maybe it would be helpful to explain what you are trying to accomplish with the SAS expressions?

Scott Barry
SBBWorks, Inc.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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