BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
elkinsbe
Obsidian | Level 7

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...

 

elkinsbe_0-1679663415119.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
HunterT_SAS
SAS Employee

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:

HunterT_SAS_0-1679664629278.png

Call it whatever you want, then change the format of that calc item to Month. 

View solution in original post

5 REPLIES 5
HunterT_SAS
SAS Employee

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:

HunterT_SAS_0-1679663847148.png

 

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.



elkinsbe
Obsidian | Level 7
First, thank you for your reply... your recommendation will not work as the blurred argument is DTDATE11 format.... your suggestion of DatePart(your date column) returns an error.... How do I fix that??
HunterT_SAS
SAS Employee

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:

HunterT_SAS_0-1679664629278.png

Call it whatever you want, then change the format of that calc item to Month. 

elkinsbe
Obsidian | Level 7
Fantastic!! I learn something new everything I use communities... Thank you for your expert assistance... (and patience with a novice like me)....
acordes
Rhodochrosite | Level 12

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 

 

 

 

 

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!

Tips for filtering data sources in SAS Visual Analytics

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.

Discussion stats
  • 5 replies
  • 532 views
  • 5 likes
  • 3 in conversation