In your load script:
RowNo() AS RowNumber
Then in your application create a text box with the expression:
I may have the syntax slightly wrong (can't test right now) but this approach should work.
Hope this helps,
Perhaps there is a better solution but the following expression will give you the value u seek:
=FieldValue('Stock Qty',round(count([Stock Qty])*0.8)-(count([Stock Qty]) -FieldValueCount('Stock Qty')))
the part after the minus sign is to adjust the rownr due to Qlikview counting two rows with the same value as one. Of course, count(distinct [Stock Qty]) would work but its not recommended to use count(distinct).
Hope this is what u were looking for.