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.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!

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