Demand Planning.Net: Are you Planning By Exception?
Demand Planning.Net
demand planning, forecasting, and exception management

The SAS INTX function is very useful however you should be careful when using the time increments

Mark C July 29, 2005

If you use

next_month=intnx('month',today,1);

it gets you the next calendar month, not one month from today. For example, today’s date is July 29, 2005 and the next_month will be defined above as August 1, 2005. So it follows the calendar month to go to the next month or the previous month. IF you use a zero increment as

next_month=intnx('month',today,0);

the result will be July 1, 2005 the first day of the current month. To get the last day of the month, you want to use the above function and subtract 1 from as in

next_month=intnx('month',today,1)-1;

which will give next_month as July 31, 2005.

Now more confusions arise only when you use the week function since businesses may have a custom week definition for their purposes. While companies typically follow the calendar month, their business week may be defined as Monday thru Sunday, or Saturday thru Friday etc. This often arises when you are using retail data from either Syndicated sources or from retailers directly such as Wal-Mart, Target. They all have their own customized week definitions.

Let us say your data is in the form of a weekending date for every week. Then you may want to use the INTNX function to grab specific weeks in your data using the Day increment as

next_week=intnx('Day',week,+7);

If you use the ‘week’ increment it will capture the following Sunday which may be incorrect, if your week does not start on a Sunday. Even if it does, the weekending notation means you are coding your week variable with a Saturday not a Sunday.

Now if your business is on a 4-4-5 week month calendar, then this raises everything to a new complication.

Back to SAS Techniques

©2004-2017 by Demand Planning, LLC. All rights reserved. Privacy policy | Refund and Exchange policy | Terms of Service | FAQ
Demand Planning, LLC is based in Boston, MA | Phone: (781) 995-0685 | Email us!

Consulting

Diagnostic |  DP Design |  Exception Management |  S&OP |  Solutions

Training

Demand Planning |  S&OP |  Retail Forecasting |  Supply Chain Analysis:  » Value Chain Metrics  » Inventory Optimization |  Supply Chain Collaboration

Industry

CPG/FMCG |  Food and Beverage |  Retail |  Pharma |  High Tech |  Other

Knowledge Base

Planning:  » Budgeting » S&OP |  Metrics: » Demand Metrics » Inventory  » Customer Service |  Collaboration:  » VMI & CMI » Account Based Forecasting
Forecasting:  » Causal Modeling  » Market Modeling  » Ship to Share |  For Students