You can use For / Next loops in a QlikView load script - and I will often enumerate around source files in a folder or rows in an existing table.
There are neater ways of achieving what you are after though. The best explanation I have seen of this is by hic in his blog posting: http://community.qlik.com/blogs/qlikviewdesignblog/2013/02/05/populating-a-sparsely-populated-field
The reference to the WHILE statement in the comments is also very useful - you can build a loop right into your load statement in a preceding load.
Hope that helps.
Well, I wouldn't use any For-Next Loop. I would suggest the below approach -
From Invoices //Assuming your Invoice table would have all the months
Left Join (Cost_Temp)
if(isnull(Cost1)<0, peek(Cost1), Cost1) as Cost
Order by month
The idea would be to populate preceding month's Cost in case current month's cost is NULL.
Hope this is of help.