BookmarkSubscribeRSS Feed
ewv
Obsidian | Level 7 ewv
Obsidian | Level 7

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 

Query properties.JPG

 

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

 

Results of Query.JPG

 

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

 

Query properties.JPG

 

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.


Datetime format in Exploration.JPGQuery properties.JPGResults of Query.JPG
2 REPLIES 2
AMos
Fluorite | Level 6

Hi,

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

 

 

ewv
Obsidian | Level 7 ewv
Obsidian | Level 7

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

sas-innovate-2024.png

📢

ANNOUNCEMENT

The early bird rate has been extended! Register by March 18 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

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
  • 2 replies
  • 1105 views
  • 0 likes
  • 2 in conversation