BookmarkSubscribeRSS Feed
Yennie
Calcite | Level 5
Hi all,

I have three variables Month, Type of Fruits and The number of sales (Count) each month. The data as arrange below.

Month Fruits Count
2007/08 Apple 5
2007/08 Apple 6
2007/08 Strawberry 4
2007/08 Strawberry 1
2007/08 Orange 22
2007/08 Orange 90
2007/07 Apple 25
2007/07 Apple 4
2007/07 Strawberry 83
2007/07 Strawberry 80
2007/07 Orange 25
2007/07 Orange 25
2007/06 Apple 10
2007/06 Apple 6
2007/06 Strawberry 7
2007/06 Strawberry 96
2007/06 Orange 61
2007/06 Orange 22

Just wondering, say for example, if I just want a line graph just for the sales of apple in that three months (Jun-Aug 2007). How do I plot it?

Hope you can help. Cheers!
Yennie
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
Most SAS procedures (including the Graph procedures) support WHERE statement processing.
Just as you can do this with PROC PRINT:
[pre]
ods listing;
proc print data=sashelp.class;
where name = 'John';
run;

OR

proc print data=work.fruit;
where fruits = 'Apple' and
year(month) = 2007;
run;
[/pre]

So will the SAS/GRAPH procedures use WHERE statements (or WHERE= data set options)
to allow you to send only a subset of observations to the procedure.

cynthia

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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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