BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. 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.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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