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

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 539 views
  • 0 likes
  • 2 in conversation