Skip to main content

Assistance with Time Ageing

Hi Brian,
How am I able to calculate the time age within the records in the database.
From the attached screen, I would like to find out the age time between row2 & row3. How am I suppose to do that.
I can do that in Excel with the =text(B3-B2,"hh:mm:ss") command, what's the @function to be used in IDEA?
Any help would be much appreciated here.
Thank you in advance.
William
 
 
 

Brian Element Mon, 07/14/2014 - 07:41

Hi William, you can use the @agetime function along with the @getNextValue function.  The @GetNextValue and @GetPreviousValue allow you to read the values in the adjoining records.  When using either of these functions you would have the name of the field within "".  Also adding indexes after could screw-up your results.  I would suggest first getting the file in the proper order by using the sort command and then using these functions.

@AgeTime(TIME, @GetNextValue("TIME"))

William Yong Tue, 07/15/2014 - 22:58

In reply to by Brian Element

Hi Brian, not sure what goes wrong here. No result display after I put in the command as suggested. Could it be due to my IDEA version here. I'm currently using v.8.0.5.243. Please advice again.
Thanks. Cheers, William

Brian Element Wed, 07/16/2014 - 07:11

William, I have attached the imd file that I created so hopefully it will help you out.  It was done on an older version of IDEA 8.4 so you shouldn't have any problem reading it.  If it doesn't help any chance you could post a sample file so I can try and figure out what the problem might be or post a screen grab of the file and the equation?

Thanks and good luck.

William Yong Thu, 07/17/2014 - 00:26

In reply to by Brian Element

Hi Brian,
Thanks for the shared file. It works, thank you very much!
However, one of my time field shown age time with 1368 as the 2nd time compared with the 1st time is after 12am. How am I able to put the parameter just for this 1 record / row here. Please refer my attached screen for more info.
Thanks in advance. William

Brian Element Thu, 07/17/2014 - 12:16

Hi William, this will set the first record to 0: @if(@Recno() = 1, 0, @AgeTime(TIME, @GetNextValue("TIME")))

You can change the 0 to something else.