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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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