BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I previously posted this question on the Procedures forum, but I think maybe it actually belongs here since this is being done in EG.

Is it possible in PROC GPLOT to plot dates along the x-axis as categorical variables instead of time-series?

My problem is that if I have 10 datapoints total that are being plotted and 6 points are in january '06 and my next 4 datapoints are in November '08 I'm getting a long straight line from the last datapoint in January until my first data point in November. I would like for this to plot the 10 points equidistant from each other instead of putting the time gap in between them.

If I use the bar-line chart and specify to use "one bar for each unique data value" it will plot like mentioned above, but I need to be able to plot multiple lines like this. I've got to believe this is possible in SAS, maybe here I would need to convert the dates to text???

Thanks for any help,
Brad
2 REPLIES 2
Doc_Duke
Rhodochrosite | Level 12
To convert a date data type to a character variable that has 'sortable' characteristics, use one of the year-month-day types, like

PUT(MyDateVar, yymmdd10.)

in the expression builder to create a text version on the original date.

Presenting a naturally scaled variable as ordinal may distort the relationship in the variables. Caveat emptor.
deleted_user
Not applicable
That works for what I'm trying to do. Thanks.

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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