01-05-2016 02:00 PM
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 ;
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.
01-05-2016 02:17 PM
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.
01-05-2016 03:01 PM
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.
01-06-2016 12:01 AM
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.
03-21-2018 03:31 PM
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.