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

previous?

Hi i have like

table1:

products:

apple

banana

orange

mango

from  xlsheet;

when i go like this

load

previous(products) as previousvalues

resident  table1;

i am getting data for previousvalues is like

previousvalues:

apple

banana

orange

it is missing mango here    why ?

whether previous will not give last record ?

pls tell me ?

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

Previous returns the preceding value of the current row so, according to the load order before banana there is apple, before orange there is banana, before mango there is orange but
for the first record, apple there is nothing before, try with

LOAD products, Previous(products) Resident myTable;
DROP Table myTable;

hope this helps

View solution in original post

3 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Previous returns the preceding value of the current row so, according to the load order before banana there is apple, before orange there is banana, before mango there is orange but
for the first record, apple there is nothing before, try with

LOAD products, Previous(products) Resident myTable;
DROP Table myTable;

hope this helps

Not applicable
Author

Other way round surely? It's the fact that mango is the last record, so can't be a previous value and show in that the field

MarcoWedel

You are talking about the same thing.

For the product 'apple' there is no previous product, while 'mango' will not be included in the PreviousProduct field.

regards

Marco