Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Get Previous Row Answer

Hi,

Im trying to get an answer for Previous Row Answer as below:

NumbersNames
1234A
1234B
12354C
12354D
12543E
1234F
54321G

The Previous im using its looking at the Previous Corresponding Same Number, so i need previous row

as like Current row is determined by the previous Row.

5 Replies
marcus_sommer

Have a look here: Peek() vs Previous() – When to Use Each.

- Marcus

Not applicable
Author

Please supply sample example

marcus_sommer

It's something like this:

t1:

Load * From Source;

t2:

Load *, if(Numbers = peek('Numbers', -1), Then, Else) as NewField Resident t1 order by Numbers;

drop tables t1;

Important is to order the load within a resident load and then check the rows against each other. maybe you need to implement a few more check-logics (if's).

- Marcus

timanshu
Creator III
Creator III

In front end, Use Above function and for script use previous function

vishsaggi
Champion III
Champion III

Hi Thabiso,

Can you attach you sample .qvw file so that we can work on it.

Thanks,

V.