BookmarkSubscribeRSS Feed
NareshAbburi
Calcite | Level 5

Hi,

I'm forecasting a variable on a weekly basis. But my requirement is daily basis. So I'm forecasting for one week and dividing that value into 7 parts for the successive dates.

My question is how do I create 6 more rows with different dates using one row data.

Please refer to the attached pics:

first one is Current Output and the next one is required output.

Kindly throw some light.

Thanks,

Naresh

BELTWAY REGIONCDVCONNECTBUSINESSQTY5/3/2015.442.1057
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/10/2015.421.6068
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/3/2015.442.1057
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/4/201563.15795
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/5/201563.15795
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/6/201563.15795
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/7/201563.15795
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/8/201563.15795
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/9/201563.15795
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/10/2015.421.6068
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/11/201560.22954
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/12/201560.22954
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/13/201560.22954
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/14/201560.22954
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/15/201560.22954
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/16/201560.22954
1 REPLY 1
slchen
Lapis Lazuli | Level 10

data have;

input (v1-v6)($) date mmddyy10. num;

format date mmddyy10.;

cards;

BELTWAY REGION CDV CONNECT BUSINESS QTY 5/3/2015 442.1057

BELTWAY REGION CDV CONNECT BUSINESS QTY 5/10/2015 421.6068

;

run;

data want(rename=(_num=num _date=date));

   set have;

   do i=0 to 6;

      if i=0 then do;

      _date=date;

  _num=num;

  num=num/7;

  output;

    end;

    else do;

       _date=intnx('day',date,i);

   _num=num;

   output;

  end;

  end;

  format _date mmddyy10.;

drop num date i;

run;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 737 views
  • 0 likes
  • 2 in conversation