Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to do where statement as follow but it I am getting error.
ID
1
2
3
4
Load ID
Where ID>LastValue(ID)-2;
Anybody can help?
Thxs
Hi
Try like this
Test1:
Load * Inline
[
ID
1
2
3
4
];
LET vMax = peek('ID', RowNo(TOTAL)-1, 'Test1');
Test:
NoConcatenate
Load * Resident Test1 where ID > '$(vMax)'-2;
Drop Table Test1;
Wish someone can help on this one
Thxs,
Alec
Badr
Try
Where ID>peek(ID)-2;
If I have misunderstood what you wish to do then please explain your requirement.
Best Regards, Bill Markham
I believe LastValue needs to have a Group clause in the load script.
Bill was correct except for one thing - you need quotes in the peek function. It would be this:
Where ID>peek('ID')-2;
Hi Guys,
Thanks for the help but I am getting no data as result.
My result table should look like
ID
3
4
Any thoughts?
Badr
I hope understand what you are after now, try this :
Where ID > previous(previous(ID))
I tested it with this :
TempTable:
LOAD * INLINE [
ID
1
2
3
4
];
noconcatenate
Table:
Load
ID
resident TempTable
Where ID > previous(previous(ID))
;
drop table TempTable ;
Best Regards, Bill
Hi
Try like this
Test1:
Load * Inline
[
ID
1
2
3
4
];
LET vMax = peek('ID', RowNo(TOTAL)-1, 'Test1');
Test:
NoConcatenate
Load * Resident Test1 where ID > '$(vMax)'-2;
Drop Table Test1;
Hi,
this returned
ID
2
3
4
Thxs,
Alec
Thank you!