I am often struggling with repeatedly loading single records with the condition that the number of iterations should be the variance between a field currently read and the same field value in the next record.
The enclosed QlikView application shows a typical setup from our ERP system. This table contains information about cost price calculation(IDs). In this case 3 calculations have been made for item 166404 and 2 for 165000. The "transdate" = validation date and thus will hold until a new calculation is performed with a newer TransDate.
Sine I want to use this table as a link table to decide which particular PriceCaldID is valid for a certain ItemID at a certain production time (=TransDate), I figured that continuously loading each record with something like this:
Transdate + Iterno() as Valid_date
While IterNo() <= Previous(transdate) - Transdate
Order by ItemID Desc,
(since I only know how to read a value from a preceeding record I obviously suggest to load the data in Descending order)