Hi I have object Report like this below Name value count ——————————————- Alan low 8 John high 3 Alan low 5 Andrew low 2 Alan high 1 Andrew high 2
could you help me to group items in this object to get group for each change in Name and each change in value, count should be summed so I should get something like below Alan low 13 John high 3 Andrew low 2 Alan high 1 Andrew high 2
For every change in column Name check column value and when you find change group Name, value and make sum of column count where ex. Name is Alan and value low, next Name Alan value high etc.
How can I do this ?
by DexterPOSH at 2013-03-08 21:48:36
Can you explain a bit more. What you want to achieve?
by mjolinor at 2013-03-10 09:24:39
One way is to accumulate the counts using a hash table with the Name and Value as the keys, and then create a new set of objects from the hash table: