The output of the below is a number 1-12... but I need the output to be Jan, Feb, March, ..., Dec. Is there another function that will output txt month names instead of a number 1-12 ?? .... BTW: I do not wish to build a custom category to equate the number output to the txt month name as my current dataset only has a few months of data... Thank you in advance for all your assistances and ideas...
What error are you getting? It should work with your data item. In case it wasn't clear, I said "your data item" as a placeholder for your actual column. All I am suggesting is you first create a calc item like this:
Call it whatever you want, then change the format of that calc item to Month.
Instead of using the Month function, you could just change the Date format to Month. I'm assuming you have a Datetime data item because you're using DatePart. The Month format isn't an option for Datetime items so this is what I would suggest:
1. Create a new calc item that's just:
DatePart(your date column)
2. Change the format of this calculated item to Month:
You can either change the format in the upper right corner when creating the calculated item, or you can change it after creation by right clicking on the data item and choosing Format.
What error are you getting? It should work with your data item. In case it wasn't clear, I said "your data item" as a placeholder for your actual column. All I am suggesting is you first create a calc item like this:
Call it whatever you want, then change the format of that calc item to Month.
It's important to understand this part of how VA handles dates.
If have a date, let's assume in ddmmyy10. format, you can duplicate the date as many times as you need different date aggregations.
Name the first copy MonthYear sales and assign the monyy format to it, i.e. MAR23.
The second copy Year sales using the year format.
Put these in a cross table and you will notice how VA nicely aggregates for your date format.
And remember that in the data table you have only 1 date, the other dates are spin-offs data views.
Depending on the object you use, dates are not accepted for a category role. then there's a trick you can apply. Create a calculated item like char_ date and use the date inside the FORMAT function selecting year for example a second argument.
good luck
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.