Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts,
How to use peek,previous in functions script level?explain with example?
The Peek function is an inter-record function that allows us to literally peek into previously-read records of a table and use its values to evaluate a condition or to affect the active record (the one being read).
The function takes one mandatory parameter, the field name into which we will "peek", and two optional parameters, a row reference and the table in which the field is located.
For example, an expression like:
1. Peek('Date', -2) :>>> This expression will go back two records in the currently-being-read table, take the value on the Date field and use it as a result of the expression.
2. peek( 'Price', 2 ) :>>> It returns the value of Price from the third record read from the current internal table.
3. peek( 'Price', 0, 'Tab1' ) :>>> It returns the value of Price from the first record read into the input table labeled Tab1.
Previous Function:
There are certainly some similarities between the two functions but there are also distinct differences that need to be taken into account when deciding which function to use.
The Similarities
The Differences
So, when is it best to use each function?
The Peek function is an inter-record function that allows us to literally peek into previously-read records of a table and use its values to evaluate a condition or to affect the active record (the one being read).
The function takes one mandatory parameter, the field name into which we will "peek", and two optional parameters, a row reference and the table in which the field is located.
For example, an expression like:
1. Peek('Date', -2) :>>> This expression will go back two records in the currently-being-read table, take the value on the Date field and use it as a result of the expression.
2. peek( 'Price', 2 ) :>>> It returns the value of Price from the third record read from the current internal table.
3. peek( 'Price', 0, 'Tab1' ) :>>> It returns the value of Price from the first record read into the input table labeled Tab1.
Previous Function:
There are certainly some similarities between the two functions but there are also distinct differences that need to be taken into account when deciding which function to use.
The Similarities
The Differences
So, when is it best to use each function?
see the attached zipfile for the example
does this help you Mahesh