BookmarkSubscribeRSS Feed
AshJuri
Calcite | Level 5

Hi everyone, 

 

I am a first time user of sas enterprise guide and I am trying to complete a simple calculation using this system. I have two date columns called "start date" and "end date". The formats of the date columns are in, for example, "08JUN2019". I calculated the difference between the two columns in order to produce the column "difference" which gives me the number of days that have elapsed. How would I calculate the average of the subtraction between "end date" and "start date" in sas enterprise guide? 

 

Thank you in advance,

3 REPLIES 3
Reeza
Super User

Use a summarize task. 

AshJuri
Calcite | Level 5

Okay, I used the "AVG" summary task. However, is it possible for this to be exported alongside the rest of the columns since it is only a single value?

Reeza
Super User

In that case, use QUERY builder and add it in as a calculated column. 

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1038 views
  • 0 likes
  • 2 in conversation