Assistance with Time Ageing

7 posts / 0 new
Last post
William Yong
Offline
Joined: 06/30/2014 - 00:37
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
 
 
 

Images: 
Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

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
Offline
Joined: 06/30/2014 - 00:37

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's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

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.

Files: 
William Yong
Offline
Joined: 06/30/2014 - 00:37

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

Images: 
Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

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.

 

William Yong
Offline
Joined: 06/30/2014 - 00:37

Thanks Brian.