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

 

Secure your spot at the must-attend AI and analytics event of 2024: SAS Innovate 2024! Get ready for a jam-packed agenda featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.

 

Register by March 1 to snag the Early Bird rate of just $695! Don't miss out on this exclusive offer. 

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 3 replies
  • 313 views
  • 3 likes
  • 2 in conversation