07-20-2017 10:42 AM - edited 07-20-2017 10:45 AM
I am trying to convert a datetime variable to NLADATMYWw. fomat as shown in the picture below (query properties) by using the SAS VA Data Preparation tool
When I preview this query and view the results within the Data Preparation application, it looks like this (Results of query), which is exactly the format I want it to be in (Calendar week followed by a year).
When I run the query and try to open the newly generated table in either the Exploration or Report Designer application, it converts to a year format (see below, Datetime Format in Exploration). I have no options to change the format within the Exploration or Report Designer application back to what I want (I know that you can change the format, but the Calendar week, Year option is not avaliable).
Is there any reason why this the Exploration or Report Designed application would change this to a year format rather than keep the format I specified in the query? I would like to separate a bunch of data by calendar week so the NLADATMYWw. format is perfect for me, but just doesn't seem to stay in that format in the other SAS VA applications.
07-25-2017 02:08 AM
You could create the formatted week yourself.
First create a calculated item _WeekNumber
_WeekNumber = WeekNumber('ENTRY_DATE'n)
Then create the formatted week as a new calculated item.
Formatted Week =
Concatenate('week ', Concatenate(Concatenate(Format('_WeekNumber'n, 'BEST2.'), ' '), Format('ENTRY_DATE'n[Raw], 'YEAR4.')))
07-30-2017 10:34 PM
I will have to try this! Do you know if this concatenated item will still be a datetime format? I would like for it to remain that way so I can utilize it in a time series animation