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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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