Discussion Board for collaboration related to QlikView App Development.
i'm in trouble because i notice that Peek() don't work with Preceding load and i don't know why.
LoadIf(COUNT=Peek(COUNT),Peek(PROG)+1,1) as PROG,*Where Len(Trim(CODE))>0;
The output i want is the following: for every COUNT a numerical sequence (PROG) if the CODE>0.
Now, all the PROG=1.
What's my mistake?
I didn't understand your question very well, maybe with an example I can understand it well.
otherwise Peek() in Qlik: finds the value of a field in a table for a row that has already been loaded or that exists in internal memory.
while in your function you use If(COUNT=Peek(COUNT),Peek(PROG)+1,1) as PROG
so you test on a value that is not yet loaded in memory "COUNT=Peek(COUNT)".
think about using "Resident".
I hope this will help you.
What you've written down is a code that identifies if the previous row is the same number.
For this to work properly, you may want to order your data by the column [COUNT] like this:
(script below is plug-and-play)
Load * INLINE [
If(COUNT=Peek(COUNT), Peek(PROG)+1,1) as PROG,
ORDER BY COUNT ASC
DROP TABLE TestData;
Keep in mind, if you only get 1's - you can check if you have only unique values in the column COUNT.
I hope that helps!
Hi guys and thanks for the suggests.
I'm sorry but i'm not able to solve this problem.
If you can, the original problem is the following:
Please, help me!!!
@Mattia Hi, it seems the post your linking to has been deleted, please provide the needed details. Thank you