Something like this:
LOAD ID, Ticket
FROM ticket.qvd (QVD)
LOAD max(ID) as MaxIDField
LET MaxIDVariable = peek(MaxIDField)
DROP TABLE MaxIDTable
SQL SELECT ID, Ticket
WHERE ID > $(MaxIDVariable)
STORE Tickets INTO ticket.qvd (QVD)
I would do as follows
MaxTicketID:LOAD Max(id) as max_id FROM ticket.qvd (qvd);
LET vMaxID = Peek('max_id'); // This will store your maximum id in the variable
DROP TABLE MaxTicketID; // You no longer need this temp table
Tickets:LOAD id, ticket FROM ticket.qvd (qvd);LOAD *;SQL SELECT id, ticket FROM ticket_table WHERE id > $(vMaxID);
Hope this helps!
EDIT: I've just seen John's post after sending. Anyway, I think the work it's worth posting.