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

Hi all,

I'm a new SAS VA user. I'm using SAS VA 8.5.

I need to calculate the difference in hours between 2 datetime items. Particularly, to calculate "How many hours does it take between Lstupdt_Timestamp and Create_Timestamp?"

 

I tried to use TreatAs(Hour) but it didn't work. The result was incorrect (screenshots below).

myleha_1-1615539254885.png

 

 

myleha_0-1615539170959.png

I switched to TimePart but the result wasn't correct, either: 

myleha_3-1615539485282.png

 

myleha_2-1615539467783.png

I don't know what went wrong. Any help would be much appreciated.

 

Thank you!

1 ACCEPTED SOLUTION
3 REPLIES 3
myleha
Obsidian | Level 7
Thank you so much! I did a bit of transformation with the data, and changed the format to HOURS like you showed and it worked!
SASKiwi
PROC Star

If you want to do this row by row from columns that are in your VA load table then you could calculate the difference in a new column in your source table before you load it into VA. 

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
  • 3 replies
  • 1090 views
  • 2 likes
  • 3 in conversation