Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a little problem when I am loading a table from a file.
I want to the save the value of the old before read record, however regarding a particular code. How is this??, as below example, for code IM2010-1234, I need to save in "Previous Date" field the value of the last date which belongs to IM2010-1234. i.e. for the first read it would be empty.
For the second IM2010-1234, I would use "exists" to check if I read it or not, if YES, then I want to get date 18/05/2009 which is the one from the first one and put it on field "Previous Date" of the second one.
For the third one same (get the last date read it), however move the one from "Previous Date" to "Before Date", and put the last read (from before) in "Previous Date." Got me??
I cannot use function "before" as that is only for the immediate record before.
Any ideas??
Many Thanks in advance.
Mauricio
| CODE | Date | Previous Date | Before Date |
| IM2010-1234 | 18/05/2009 | ||
| IM2010-8877 | 17/10/2009 | ||
| IM2010-4444 | 21/10/2009 | ||
| IM2009-3344 | 23/11/2009 | ||
| IM2010-1234 | 18/12/2009 | ||
| IM2010-9999 | 21/12/2009 | ||
| IM2008-9876 | 05/01/2010 | ||
| IM2008-9877 | 06/01/2010 | ||
| IM2010-8877 | 09/01/2010 | ||
| IM2010-1234 | 13/01/2010 |
Mauricio,
I would use the 'lookup' function for this (refer to the help file for syntax). this will allow you to get the value of a field in a specific row in a specific tabele. First to calculate the 'Before date' and then to populate 'previous date'. you could use the 'max' function to get the highest previous date for the id. I have not tested this for this particular scenario, but if you play around with it a bit, you can probably figure it out.
when you are loading data sort it by Code, Date Asc and utilize previous() fucntion.
If you explain this bit (I am confused):
For the third one same (get the last date read it), however move the one from "Previous Date" to "Before Date", and put the last read (from before) in "Previous Date." Got me??
then I can send you an example script.
Karol
Dear Hans,
Mnay thanks for your tip, I will try and check.
Again, many thanks.
Mauriccio
Dear Karol,
Yes, I will try that. Actually you have gave me another good idea to do so.
Many thanks again!!!
Mauriccio