I have an array as follows:
Asia India Calcutta 100 200
Asia India Chennai 200 400
Asia India Mumbai 100 300
Asia PAK XXXXXX 100 300
Asia PAK SSSSSS 200 100
Americas Canada Ottawa 200 200
Americas Canada Toronto 120 200
Americas Mexico Sonoro 110 500
I need to filter the above dataset also calculating the sum of each region by the use of a specific filter such as a region name is given.(eg. Asia)
Output for filter Asia must give me :
India 400 900
PAK 300 400
How is this possible in Flex array 2D.
Use the example array as the input to a function and create the second array as the output.
Loop through the first array finding the unique country names for the filter region, then for each country name, sum entries for that country, then add a row for the country to the output array.
The above method you suggest seems to be static.I need it dynamically wherein the filter and number of numerical columns are dynamic , we cannot predict the incoming array columns count as it is not static.So could you suggest a detailed solution dynamically?