Help using Base SAS procedures

add cumulative sum column

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 13
Accepted Solution

add cumulative sum column

Need help on creating a sum column by group.

Here's the sample:

groupnamevaluewant_column
grp1name111
grp1name223
grp1name336
grp1name4410
grp2name555
grp2name6611
grp2name7718
grp2name8826

Thanks,


Accepted Solutions
Solution
‎10-29-2014 10:02 PM
Trusted Advisor
Posts: 1,228

Re: add cumulative sum column

data want;

set have;

by group;

if first.group then want_column=0;

want_column+value;

run;

View solution in original post


All Replies
Solution
‎10-29-2014 10:02 PM
Trusted Advisor
Posts: 1,228

Re: add cumulative sum column

data want;

set have;

by group;

if first.group then want_column=0;

want_column+value;

run;

🔒 This topic is solved and locked.

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

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