1 Reply Latest reply on Mar 22, 2008 3:24 PM by flashharry!

    ArrayCollection group filter help

    flashharry!
      Hi, Great forum and great help.

      I have flex 3 which I believe as new group function for array collections, but I have not installed yet as I'm 2/3rds through a hugh project and wanted to wait until his is done.

      So in Flex 2.01 and have an array collection of complex data. The array collection is built form a returned result set from mysql. Each object in the collection is an event. These events could be one of four types and for clarity we will call them event 1,2,3 & 4. Each object in the collection contains lots of other data like user that fired the event, tStamp it happened, quarter it happened in, month and year event happened.

      There could be hundreds of these events happen each month. One of the displays I wish to show is Total for event type for that month or quarter.

      Need to show total number of event type 1, for each month.
      Need to show total number of event type 2, for each month.
      Need to show total number of event type 3, for each month.
      Need to show total number of event type 4, for each month.

      I can filter data, but I need to calculate data. I can do this via remote calls to mysql and having my sql do the sorting, but I would like to make one init call to mysql and sort the array collection in flex.

      I hope this makes sense :)
      I.e
      For each event add up event type total for each month.
      extract of array collection
      [EventType:1, month:3, quarter:q1, year:2006,user:x]
      [EventType:1, month:3, quarter:q1, year:2006,user:y]
      [EventType:2, month:3, quarter:q1, year:2006,user:y]
      [EventType:1, month:3, quarter:q1, year:2006,user:y]
      [EventType:1, month:4, quarter:q1, year:2006,user:y]