Data visualization with SAS programming

How to plot a line graph for jsut one value within a variable?

Reply
Frequent Contributor
Posts: 78

How to plot a line graph for jsut one value within a variable?

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
SAS Super FREQ
Posts: 8,820

Re: How to plot a line graph for jsut one value within a variable?

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
Ask a Question
Discussion stats
  • 1 reply
  • 110 views
  • 0 likes
  • 2 in conversation