Exploring, modeling, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

DATETIME variable converted from from NLADATMYWw to YEAR format when going from query to exploration

Reply
Occasional Contributor ewv
Occasional Contributor
Posts: 7

DATETIME variable converted from from NLADATMYWw to YEAR format when going from query to exploration

[ Edited ]

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
New Contributor
Posts: 3

Re: DATETIME variable converted from from NLADATMYWw to YEAR format when going from query to explora

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

 

 

Occasional Contributor ewv
Occasional Contributor
Posts: 7

Re: DATETIME variable converted from from NLADATMYWw to YEAR format when going from query to explora

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

Ask a Question
Discussion stats
  • 2 replies
  • 291 views
  • 0 likes
  • 2 in conversation