Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
if my max batch_id is 23 and i wants to compare it with previous batch id then how to get previous batch id as numbers are not consecutive.eg if my previous batch id is 17.
use peek or previous function
Try this way
Table1:
Load batch_id From Table;
Max_Batch_Table:
Load Max(batch_id) as Max_Batch Resident Table1;
Let vMaxID = Peek('Max_Batch_Table', -1, 'Max_Batch');
Final:
NoConcatenate
Load If(Previous(batch_id)=$(vMaxID), 1,0) as flag, batch_id resident Table1;
Drop Table Table1;