BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
ishaqwright21o
Calcite | Level 5

Hey,

I am trying to create an sgplot with for the months by year. 

Help....This is what i have tried so far.

 

proc sqplot data=mydata;

series x=months(char) y=nfreq /group=year(char);

run;

 

I was hoping sas could calculate the frequency of each month(nfreq). Looks like thats not the case. 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
You're correct. You can pre-summarize your data using PROC FREQ, MEANS, SQL, proc of your choice and then display it using SGPLOT.

Note that PROC FREQ will also generate graphics but bar charts. Bar charts within SGPLOT do offer summarization options but not line charts.
For months to display appropriately it's probably best to convert that to a SAS date as well.

View solution in original post

1 REPLY 1
Reeza
Super User
You're correct. You can pre-summarize your data using PROC FREQ, MEANS, SQL, proc of your choice and then display it using SGPLOT.

Note that PROC FREQ will also generate graphics but bar charts. Bar charts within SGPLOT do offer summarization options but not line charts.
For months to display appropriately it's probably best to convert that to a SAS date as well.

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!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

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