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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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