I have an two dimensional array with three elements for each item(4624 items), One array for each employee(26-40). These are date, hours, taskid. My goal is to have a report that shows 39 weeks from this week and show the amount of hours each employee has scheduled each week. My question is how to get the data from my array, grouping on week ending matching each of the 39 weeks in my report.
If I loop thru the 39 week periods then loop thru my array to find matching dates would this be the most effecient way?
By the way I had this working by using sql to feed data into an iseries file then getting data back out with sql etc. But this is way too much traffic on our server.
Joined: Nov 11, 2004
Why are you using multi dimensional arrays to represent class data?
Why not create an Employee object that has 3 members, hours, date, taskid. You can then just have a regular ol 1-d array of Employees.
Joined: Apr 26, 2008
Is it possible to use a hash? That way you could have a key(say date) that would contain all the values you are looking for. Looking through the API, it looks as though a hashtable would be your best bet.