I am performing data manipulation for VA and I have date valiable in date format.
I calculated month using SAS function in SAS-EG and I got numeric output (1,2,3...). I wanted to have month in Character form (Jan, Feb..etc). So, I used Proc format; value m ;
1='Jan'....;
run;
I am using this in a Line Graph and month is a category variable on X-axis, when I sort, I get the sorting in Alphabetical order Apr being the first
I tried little variation in proc format:
1='1:Jan' and when I sort I get this order 1, 11, 12, 2, 3, 4,
Is there any way I can get month in Character form and when I sort I get the actual order in Visual Analytics.
Thanks
You're very close with your final variation. You could try adding a leading zero for months 1-9:
value m 1='01:Jan' ......;
Or you could use a leading blank:
value m 1=' 1:Jan' ......;
Again, the leading blank would be for months 1-9 only.
Use your original date data item in SAS Visual Analytics and simply change the format in the data pane properties panel to a month format and you'll get the ascending month order you desire.
Kind Regards,
Michelle
Thanks. One more thing. Is there any way I can find teh Week number in VA. Instead of using a week function in EG?
There is no week related format available within the Visual Analytics data item properties pane however you can create a calculated item and use the WeekNumber( ) operator on date data item that will return a week number (0-53) for the date.
If this has answered your question, please mark the question as solved.
Kind Regards,
Michelle
In SAS VA under the data selection on the left panel, you can right click the data element and select "New Custom Sort". A window will pop up and you can then put the data value in the order you would like to see in Graph or Table.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.