Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Peek command in the script

Have input data with field name

Value

Have statement in load script as

Let vPreValue = peek('Value');

With this statement I am trying to define a new variable

vPreValue

as the value read in for the field

Value

in the previous record

After reload, when I create a new sheet object as a chart/straight table, for the straight tagble in the expression editor under variables I see a list of available variable names to use in the straight table but I don't see the new varible

vPreValue

that I thought I defined in the load script. I am new to this, so I probably don't have the correct concept or syntax here. What am I doing wrong?

Here is what I am trying to accomplish: My data consists of a field "Date" which contains dates, and a field "Value" which contains the numeric value associated with each date. I want to define a new variable "vPreValue" for each value of "Date" that contains "Value" from the previous record.

Any suggestions.

Thanks

Bill

1 Reply
Not applicable
Author

for using peek with just one parameter, you have to usit inside a load statement

if you are going to use peek with a variable, you have to specify the source table e.g. :

Let vPreValue = peek( 'Value', 0, TableWithValues);

0 --> You have to specify the record you want, usually , using this kind of function envolve 'for' control statement .

atte

fq