Need help with Loop!


Need help with Loop!


I am not allowed to create a procedure. But I think I'll have to implement a loop within a macro for the following scenario. Suggestions other than loop are welcome too.
This is my lookup table.
Team Hierarchy Count SEQ_NUM
Team-B 1 22774 1
Team-J 5 7114 2
Team-O 3 59071 3
Team-R 1 11387 4
Team-R 2 1637 5
Team-Y 2 4092 6

And this one is my actual table where i need to populate the teams as per the tasks. Count column in the look up table is the number of tasks for each Hierarchy which has to be assigned ot a particular team. Eg. There are 22774 tasks with hierarchy 1 which should get assigned to Team B and 7114 tasks with hierarchy 5 should get assigned to TeamJ.

Tasks Hierarchy Team
100 1 Null
101 1 Null
102 2 Null
103 5 Null
104 3

Please let me kow how to implement this.

Tags (1)