You can try and create a flag like:
Load * Inline [
Load *, if(Supplier=previous(Supplier) and City=previous(City), 0, 1) as LatestFlag
Order by City, Supplier, ContractNo desc;
Drop Table Table1;
This will be a 1 for your latest contractNo and 0's for the rest. Please find attached.
Hope this helps!
peekexample.qvw 149.0 K