BookmarkSubscribeRSS Feed
erikhendrickson
Calcite | Level 5
I am trying to figure out how to make my xaxis with the weekly intervals list the end of week (Saturday) rather than the start of the week (Sunday). Any help would be greatly appreciated. proc sgplot data=merged_gender (where=(&period)) dattrmap=attrmap; title1 "Opioid Encounters by Gender"; yaxis label="Number of Encounters"; series y=MovAv_OPIOID_ENCOUNTER x=admitdt1 / group=gender attrid=gender name="series1" lineattrs=(pattern=solid thickness=2); reg y=OPIOID_ENCOUNTER x=admitdt1 / group=gender nomarkers attrid=gender lineattrs=(pattern=dash thickness=2); xaxis label="Encounter Date" tickvalueformat=mmddyy8. interval=week offsetmin=0 offsetmax=0; symbol1 interpol=join width=10 ci=cxEC8B16 cv=cx546EF0; keylegend "series1" / title=''; run;
3 REPLIES 3
Ksharp
Super User
data have;
call streaminit(123);
do date='04jan2020'd to '01jun2020'd;
y=rand('uniform');output;
end;
format date date9.;
run;

proc sgplot data=have;
series x=date y=y;
xaxis type=linear  values=('04jan2020'd to '01jun2020'd by week) fitpolicy=rotate ;
run;
erikhendrickson
Calcite | Level 5

Thank you!

 

Is there a way to do the same process but with a date format mmddyy8. ?

Ksharp
Super User
of course. Just change format:
format date date9.;
---->
format date mmddyy8.;

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
  • 3 replies
  • 224 views
  • 3 likes
  • 2 in conversation