BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Ripalsshah0
Fluorite | Level 6

Here below is my example data.

product     price

boots         $20

slipper        $30

trainners     $40

boots           $25

boots           $65

 

from above dataset I want to do sum of Boots Price.

 

What function should i use to add all value in column.

 

thanks,

Ripal

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

@Ripalsshah0 wrote:

Here below is my example data.

product     price

boots         $20

slipper        $30

trainners     $40

boots           $25

boots           $65

 

from above dataset I want to do sum of Boots Price.

 

What function should i use to add all value in column.

 

thanks,

Ripal


proc means data=have(where=(product='boots')) sum;
var price;
run;

or even better yet, you can get the sums of all products

 

proc means data=have sum;
class product;
var price;
run;
--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

@Ripalsshah0 wrote:

Here below is my example data.

product     price

boots         $20

slipper        $30

trainners     $40

boots           $25

boots           $65

 

from above dataset I want to do sum of Boots Price.

 

What function should i use to add all value in column.

 

thanks,

Ripal


proc means data=have(where=(product='boots')) sum;
var price;
run;

or even better yet, you can get the sums of all products

 

proc means data=have sum;
class product;
var price;
run;
--
Paige Miller
Ripalsshah0
Fluorite | Level 6
thanks its working.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

LIBNAME 101

Follow along as SAS technical trainer Dominique Weatherspoon expertly answers all your questions about SAS Libraries.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 850 views
  • 1 like
  • 3 in conversation