I'd like to get some feedback on my design issue. My code goes through the docs in a view. Each doc has the name of a piece of software, the cost and the users who have it. I take each user's name, looks up their user record and gets their group and unit number, etc. I take this and create/update a different doc, which I pull into a set of views totaling the data by unit, or group, etc.
To do this I build an array with the group and user name. (example: accounting - John Smith). I sort the array, so now it's in group order. Then I carefully traverse down the list, parse out the group name and create a group record and update it with the users criteria. Always checking for a change in the group name.
This works, but it feels like such a clumsy solution. Have any of you written a similar app? I'd appreciate any feedback on the approach.