Days to 30 days interval data creation

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

Days to 30 days interval data creation

I have data as daily (attached below):
I want to make as 30 days (from i2 variable)  interval data as, for example, 
ID END sum_fill_i
123699041 30 VVV (whatever sum of this fill_i between 1 and 30)
next row would be as below:
123699041 60 XXX (next summation of the fill_i).
 
Can you help please? Thank you.
 
ENROLID i2 fill_i
123699040111
123699040121
123699040131
123699040141
123699040151
123699040161
123699040171
123699040181
123699040191
1236990401101
1236990401111
1236990401121
1236990401131
1236990401141
1236990401151
1236990401161
1236990401171
1236990401181
1236990401191
1236990401201
1236990401211
1236990401221
1236990401231
1236990401241
1236990401251
1236990401261
1236990401271
1236990401281
1236990401291
1236990401301
12369904013232
12369904013332
12369904013432
12369904013532
12369904013632
12369904013732
12369904013832
12369904013932
12369904014032
12369904014132
12369904014232
12369904014332
12369904014432
12369904014532
12369904014632
12369904014732
12369904014832
12369904014932
12369904015032
12369904015132
12369904015232
12369904015332
12369904015454
12369904015554
12369904015654
12369904015754
12369904015854
12369904015954
12369904016054
12369904016154
12369904016254
12369904016354
12369904016454
12369904016554
12369904016654
12369904016754
12369904016854
12369904016954
12369904017054
12369904017154
12369904017254
12369904017354
12369904017454
12369904017554
12369904017654
12369904017754
12369904017854
12369904017954
12369904018054
12369904018154
12369904018254
12369904018354
12369904019292
12369904019392
12369904019492
12369904019592
12369904019692
12369904019792
12369904019892
12369904019992
123699040110092
123699040110192
123699040110292
123699040110392
123699040110492
123699040110592
123699040110692
123699040110792
123699040110892
123699040110992
123699040111092
123699040111192
123699040111292
123699040111392
123699040111492
123699040111592
123699040111692
123699040111792
123699040111892
123699040111992
123699040112092
123699040112192
1236990401171171
1236990401172171
1236990401173171
1236990401174171
1236990401175171
1236990401176171
1236990401177171
1236990401178171
1236990401179171
1236990401180171
1236990401181171
1236990401182171
1236990401183171
1236990401184171
1236990401185171
1236990401186171
1236990401187171
1236990401188171
1236990401189171
1236990401190171
1236990401191171
1236990401192171
1236990401193171
1236990401194171
1236990401195171
1236990401196171
1236990401197171
1236990401198171
1236990401199171
1236990401200171
1236990401228228
1236990401229228
1236990401230228
1236990401231228
1236990401232228
1236990401233228
1236990401234228
1236990401235228
1236990401236228
1236990401237228
1236990401238228
1236990401239228
1236990401240228
1236990401241228
1236990401242228
1236990401243228
1236990401244228
1236990401245228
1236990401246228
1236990401247228
1236990401248228
1236990401249228
1236990401250228
1236990401251228
1236990401252228
1236990401253228
1236990401254228
1236990401255228
1236990401256228
1236990401257228
1236990401268268
1236990401269268
1236990401270268
1236990401271268
1236990401272268
1236990401273268
1236990401274268
1236990401275268
1236990401276268
1236990401277268
1236990401278268
1236990401279268
1236990401280268
1236990401281268
1236990401282268
1236990401283268
1236990401284268
1236990401285268
1236990401286268
1236990401287268
1236990401288268
1236990401289268
1236990401290268
1236990401291268
1236990401292268
1236990401293268
1236990401294268
1236990401295268
1236990401296268
1236990401297268
1236990401299299
1236990401300299
1236990401301299
1236990401302299
1236990401303299
1236990401304299
1236990401305299
1236990401306299
1236990401307299
1236990401308299
1236990401309299
1236990401310299
1236990401311299
1236990401312299
1236990401313299
1236990401314299
1236990401315299
1236990401316299
1236990401317299
1236990401318299
1236990401319299
1236990401320299
1236990401321299
1236990401322299
1236990401323299
1236990401324299
1236990401325299
1236990401326299
1236990401327299
1236990401328299
1236990401347347
1236990401348347
1236990401349347
1236990401350347
1236990401351347
1236990401352347
1236990401353347
1236990401354347
1236990401355347
1236990401356347
1236990401357347
1236990401358347
1236990401359347
1236990401360347
1236990401361347
1236990401362347
1236990401363347
1236990401364347
1236990401365347
1236990401366347
1236990401367347
1236990401368347
1236990401369347
1236990401370347
1236990401371347
1236990401372347
1236990401373347
1236990401374347
1236990401375347
1236990401376347
1236990401409409
1236990401410409
1236990401411409
1236990401412409
1236990401413409
1236990401414409
1236990401415409
1236990401416409
1236990401417409
1236990401418409
1236990401419409
1236990401420409
1236990401421409
1236990401422409
1236990401423409
1236990401424409
1236990401425409
1236990401426409
1236990401427409
1236990401428409
1236990401429409
1236990401430409
1236990401431409
1236990401432409
1236990401433409
1236990401434409
1236990401435409
1236990401436409
1236990401437409
1236990401438409
1236990401443443
1236990401444443
1236990401445443
1236990401446443
1236990401447443
1236990401448443
1236990401449443
1236990401450443
1236990401451443
1236990401452443
1236990401453443
1236990401454443
1236990401455443
1236990401456443
1236990401457443
1236990401458443
1236990401459443
1236990401460443
1236990401461443
1236990401462443
1236990401463443
1236990401464443
1236990401465443
1236990401466443
1236990401467443
1236990401468443
1236990401469443
1236990401470443
1236990401471443
1236990401472443
1236990401474474
1236990401475474
1236990401476474
1236990401477474
1236990401478474
1236990401479474
1236990401480474
1236990401481474
1236990401482474
1236990401483474
1236990401484474
1236990401485474
1236990401486474
1236990401487474
1236990401488474
1236990401489474
1236990401490474
1236990401491474
1236990401492474
1236990401493474
1236990401494474
1236990401495474
1236990401496474
1236990401497474
1236990401498474
1236990401499474
1236990401500474
1236990401501474
1236990401502474
1236990401503474
1236990401822822
1236990401823822
1236990401824822
1236990401825822
1236990401826822
1236990401827822
1236990401828822
1236990401829822
1236990401830822
1236990401831822
1236990401832822
1236990401833822
1236990401834822
1236990401835822
1236990401836822
1236990401837822
1236990401838822
1236990401839822
1236990401840822
1236990401841822
1236990401842822
1236990401843822
1236990401844822
1236990401845822
1236990401846822
1236990401847822
1236990401848822
1236990401849822
1236990401850822
1236990401851822
123699040111161116
123699040111171116
123699040111181116
123699040111191116
123699040111201116
123699040111211116
123699040111221116
123699040111231116
123699040111241116
123699040111251116
123699040111261116
123699040111271116
123699040111281116
123699040111291116
123699040111301116
123699040111311116
123699040111321116
123699040111331116
123699040111341116
123699040111351116
123699040111361116
123699040111371116
123699040111381116
123699040111391116
123699040111401116
123699040111411116
123699040111421116
123699040111431116
123699040111461146
123699040111471146
123699040111481146
123699040111491146
123699040111501146
123699040111511146
123699040111521146
123699040111531146
123699040111541146
123699040111551146
123699040111561146
123699040111571146
123699040111581146
123699040111591146
123699040111601146
123699040111611146
123699040111621146
123699040111631146
123699040111641146
123699040111651146
123699040111661146
123699040111671146
123699040111681146
123699040111691146
123699040111701146
123699040111711146
123699040111721146
123699040111731146
123699040111811181
123699040111821181
123699040111831181
123699040111841181
123699040111851181
123699040111861181
123699040111871181
123699040111881181
123699040111891181
123699040111901181
123699040111911181
123699040111921181
123699040111931193
123699040111941193
123699040111951193
123699040111961193
123699040111971193
123699040111981193
123699040111991193
123699040112001193
123699040112011193
123699040112021193
123699040112031193
123699040112041193
123699040112051193
123699040112061193
123699040112071193
123699040112081193
123699040112091193
123699040112101193
123699040112111193
123699040112121212
123699040112131212
123699040112141212
123699040112151212
123699040112161212
123699040112171212
123699040112181212
123699040112191212
123699040112201212
123699040112211212
123699040112221212
123699040112231212
123699040112241212
123699040112251212
123699040112261212
123699040112271212
123699040112281212
123699040112291212
123699040112301212
123699040112311212
123699040112321212
123699040112331212
123699040112341212
123699040112351212
123699040112361212
123699040112371212
123699040112381212
123699040112391212
123699040112401240
123699040112411240
123699040112421240
123699040112431240
123699040112441240
123699040112451240
123699040112461240
123699040112471240
123699040112481240
123699040112491240
123699040112501240
123699040112511240
123699040112521240
123699040112531240
123699040112541240
123699040112551240
123699040112561240
123699040112571240
123699040112581240
123699040112591240
123699040112601240
123699040112611240
123699040112621240
123699040112631240
123699040112641240
123699040112651240
123699040112661240
123699040112671240
123699040112681268
123699040112691268
123699040112701268
123699040112711268
123699040112721268
123699040112731268
123699040112741268
123699040112751268
123699040112761268
123699040112771268
123699040112781268
123699040112791268
123699040112801268
123699040112811268
123699040112821268
123699040112831268
123699040112841268
123699040112851268
123699040112861268
123699040112871268
123699040112881268
123699040112891268
123699040112901268
123699040112911268
123699040112921268
123699040112931268
123699040112941268
123699040112951268
123699040112961268
123699040112971268
123699040113171317
123699040113181317
123699040113191317
123699040113201317
123699040113211317
123699040113221317
123699040113231317
123699040113241317
123699040113251317
123699040113261317
123699040113271317
123699040113281317
123699040113291317
123699040113301317
123699040113311317
123699040113321317
123699040113331317
123699040113341317
123699040113351317
123699040113361317
123699040113371317
123699040113381317
123699040113391317
123699040113401317
123699040113411317
123699040113421317
123699040113431317
123699040113441317
123699040113451317
123699040113461317
123699040113761376
123699040113771376
123699040113781376
123699040113791376
123699040113801376
123699040113811376
123699040113821376
123699040113831376
123699040113841376
123699040113851376
123699040113861376
123699040113871376
123699040113881376
123699040113891376
123699040113901376
123699040113911376
123699040113921376
123699040113931376
123699040113941376
123699040113951376
123699040113961376
123699040113971376
123699040113981376
123699040113991376
123699040114001376
123699040114011376
123699040114021376
123699040114031376
123699040114221422
123699040114231422
123699040114241422
123699040114251422
123699040114261422
123699040114271422
123699040114281422
123699040114291422
123699040114301422
123699040114311422
123699040114321422
123699040114331422
123699040114341422
123699040114351422
123699040114361422
123699040114371422
123699040114381422
123699040114391422
123699040114401422
123699040114411422
123699040114421422
123699040114431422
123699040114441422
123699040114451422
123699040114461422
123699040114471422
123699040114481422
123699040114491422
123699040115091509
123699040115101509
123699040115111509
123699040115121509
123699040115131509
123699040115141509
123699040115151509
123699040115161509
123699040115171509
123699040115181509
123699040115191509
123699040115201509
123699040115211509
123699040115221509
123699040115231509
123699040115241509
123699040115251509
123699040115261509
123699040115271509
123699040115281509
123699040115291509
123699040115301509
123699040115311509
123699040115321509
123699040115331509
123699040115341509
123699040115351509
123699040115361509
123699040115541554
123699040115551554
123699040115561554
123699040115571554
123699040115581554
123699040115591554
123699040115601554
123699040115611554
123699040115621554
123699040115631554
123699040115641554
123699040115651554
123699040115661554
123699040115671554
123699040115681554
123699040115691554
123699040115701554
123699040115711554
123699040115721554
123699040115731554
123699040115741554
123699040115751554
123699040115761554
123699040115771554
123699040115781554
123699040115791554
123699040115801554
123699040115811554
123699040117341734
123699040117351734
123699040117361734
123699040117371734
123699040117381734
123699040117391734
123699040117401734
123699040117411734
123699040117421734
123699040117431734
123699040117441734
123699040117451734
123699040117461734
123699040117471734
123699040117481734
  

Accepted Solutions
Solution
‎03-23-2018 12:51 AM
Esteemed Advisor
Posts: 5,543

Re: Days to 30 days interval data creation

You can summarize in a single step with

 

proc sql;
create table want as
select 
    enrolid,
    30*ceil(i2/30) as end,
    sum(fill_i) as sum_fill_i
from have
group by enrolid, calculated end;
quit;
PG

View solution in original post


All Replies
Solution
‎03-23-2018 12:51 AM
Esteemed Advisor
Posts: 5,543

Re: Days to 30 days interval data creation

You can summarize in a single step with

 

proc sql;
create table want as
select 
    enrolid,
    30*ceil(i2/30) as end,
    sum(fill_i) as sum_fill_i
from have
group by enrolid, calculated end;
quit;
PG
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 107 views
  • 1 like
  • 2 in conversation