Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
is there a way to loop through the records of a loaded table row by row?
please advise
what I also want is suppose I'm in row 2 I want to read columns of the previous row
Not knowing what is your objective her some examples for previous record and loop in the script
RawData:Load * Inline [ ID, value 4, B 2, A 6, C] ;// using previous functionData:Load *, previous(ID) as PreID previous(value) as PreValue ;Load *Resident RawData Order by 'ID' asc ;//one way of looping through teh recordsfor i = 1 to NoOfRows('Data') DataLoop: Load peek('ID', $(i)-1, 'Data') as LoopResultID, $(i) as LoopCounter Resident Data where $(i) = RecNo() ;next
RawData:
Load * Inline [
ID, value
4, B
2, A
6, C
] ;
// using previous function
Data:
Load *,
previous(ID) as PreID
previous(value) as PreValue ;
Load *
Resident RawData
Order by 'ID' asc ;
//one way of looping through teh records
for i = 1 to NoOfRows('Data')
DataLoop:
Load
peek('ID', $(i)-1, 'Data') as LoopResultID,
$(i) as LoopCounter
Resident Data
where $(i) = RecNo() ;
next