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

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