I have a pretty complicated code to find out the valid cost_center for every employee for every single day from his/her join_date to (his/her leaving_date or today).
The code works for one single employee, I have thoroughly tested it on a few quite difficult scenarios and it was correct all the way.
Now I've made this into a subroutine and built a FOR...NEXT loop over the employees and call this subroutine once per line (Í pass the line_nr to the subroutine, not the emp_ID, I think that simple consecutive numbers are easiest for QlikView and thus fastest)
=> The code runs error-free through all lines of the employee_list.`
The only remaining problem - I hope it's the only one remaining - is: The loops goes like
FOR i = 1 TO NoOfRows('Tablename')
At the end of this, I just wanted to have a look at my counter i to see if it had the right value and I saw just that nr. of variables there - one variable labeled '1', one labeled '2' and so on all the way through to 1.000+
Is there some way I can drop those along the way?
Thanks a lot!
P.S.: I create several variables in every run of the subroutine, with both SET and LET