Suppose below is the query Result:
Metrix No. Org Bus unit Juris Title
821 ABC ABC Business AZ AZ cleanup
923 PQR PQR Business CT CT Cleanup
923 PQR PQR Business N4 N4 Cleanup
923 PQR PQR Business N4 N4 add page
923 PQR PQR Business N3 N3 Cleanup
Corp. Entity Customer Segment State Project Description
ABC ABC Business AZ AZ Cleanup
PQR PQR Business CT,N4,N3 CT Cleanup
Thanks for your input, but using MAP was not feasible for me.
So I made one method which takes 'org' , the entire records and the index ( from where the iteration on records would start) as input parameter and gives STATE(as mentioned in result page) as output.
I also created one more Bean which had only those values which were required by the result page. I iterated the main list of records and whenever got new org , I passed the details to the method which provided me the combined State list. Then these values (Corp. Entity, Customer Segment, State , Project Description) was entered into new Bean.
Now while displaying the data, I iterated it through Array of new Bean which had only 4 values.