I'm wonder if it it possible to display a day and month only as a date in a time series chart?
As an example, 1Apr 2Apr 3Apr etc
I can't seem to find that format. If not, is there another way to achieve this? Because we are trying to compare 1Apr from 2019 for example to 1Apr 2020 so we can't include the years. Or do you think that I should just convert to a categorical value and use that in a line chart?
This is in SAS VA 8.5 or SAS Viya 3.5
I actually found a way around it and created a MON-Day string format and used that in a line chart BUT I can't sort it. It was initially something like 1-Jun but then I changed in to Jun-1 so I could sort better but obviously it's still not sorted correctly. Line charts, it seems, don't have the ability to sort by a hidden variable as a drop-down object would. any workarounds for this?
Thank you for responding so quickly! Right now my list is short so it's manageable but it wouldn't be as you mentioned with 365 values. Is there any way to customize the date further? I'm wondering why there is no day/month format in SAS. It seems like a feature we would want in a time series?
My generic approach is to reshape data a bit prior to plotting:
data template; set have; plotdate = (month(date),day(date),1960); year = year(date); run;
Proc sort data=template;
by year plotdate;
Use the Plotdate as the xaxis variable with a format of Date5. , use year as a grouping variable to legend entries and different appearance in the plots for the years.
Thanks! I will try this. I'm assuming though the SAS VA 8.4 time series chart will accept the DATE5. format from the dataset since there is no DATE5. format within SAS VA that I could find and that the time series will sort DATE5. correctly.
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.
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.