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
Diamond | Level 26
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

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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