Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
curiousfellow
Specialist
Specialist

stuck with peek function

I use the peek() function a lot, and most times I get the results I expect.

Since yesterday however, when using this function no results are returned.

Because of that I made a simple test, in the app where I have the problems.

I use these scripts :

EmployeeDates:
Load * Inline [
name|number
a|1
b|2
c|3
d|4
e|5
f|6
g|7
h|8
i|9
]
(delimiter is '|');

second:
Load
EmployeeDates.name,
EmployeeDates.number,
peek(second.EmployeeDates.number, -1) as previousnumber
Resident EmployeeDates;

In the resulting table field previousnumber is empty (or null)

We are using version 12.10

When I use the script in a new app, I do not get results either for field "previousnumber"peektest.jpg

 

 

  

3 Replies
Gysbert_Wassenaar

Looks like you qualify your fields and peek doesn't like that. Try it without qualifying everything.


talk is cheap, supply exceeds demand
curiousfellow
Specialist
Specialist
Author

I allways use qualify. And so far peek had no problems with that.

I assume that when I don't use qualify I have to use the table name in the Peek.

I will try if my test runs without using qualify, but I am sure it gives me al lot of new problems (synthetic keys etc.)

 

curiousfellow
Specialist
Specialist
Author


strange , in my mail I got a copy from an answer from you, but i can't see it here, allthough it sayes you replied twice.

Your answer was : "

You're peeking into a field you're creating in that same load statement and using that same peek to fill that field. If you never first put a value in that field then peek can't find any value in it."

If it was not your intention to cancel this answer, than I do not understand your reply.

I thought that the peek function made it possible to get the value of the previous row of the table you are loading.

I do not check a new field, i use the value of Employeedates.number which allready exists.