
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Peek function
tab1:
load * Inline
[Dat, Countr, Produc, Amoun
2022-01-20, Canada, Washer, 6];
tab12:
load Dat,Peek('Dat') resident tab1; //gives null value
let v1=Peek('Dat'); //gives date value
trace v1 is $(v1);
How are these two different : Peek in load statement and Peek in variable
Accepted Solutions

.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Load statement loops over the tab1 table, so when it reads row 1, the Peek() function will try to read from the previous row. But since this doesn't exist, Peek() will return NULL. If there had been a 2nd row, the Peek() would have returned the "Dat" from row 1.
The Let statement does not loop over the tab1 table. Instead the Peek() just looks in the existing table, and picks out an existing value. If no row number is specified, it will pick the last row, i.e. '2022-01-20'.

.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Load statement loops over the tab1 table, so when it reads row 1, the Peek() function will try to read from the previous row. But since this doesn't exist, Peek() will return NULL. If there had been a 2nd row, the Peek() would have returned the "Dat" from row 1.
The Let statement does not loop over the tab1 table. Instead the Peek() just looks in the existing table, and picks out an existing value. If no row number is specified, it will pick the last row, i.e. '2022-01-20'.
