How to filter 2D array in Flex and perform computation based on Filtering

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.

Similar Messages

  • Anyone know how to gernerate CRUD applications with flex and coldfusion?

    Anyone know how to gernerate CRUD applications with flex and
    coldfusion? I am working with a remote coldsfusion installation
    with MS SQL and I don't have RDS.

    You might investigate "squidhead". It is CF based. I'm not
    sure if it has any Flex related features.
    http://squidhead.riaforge.org/

  • How to get the all process orders and outbound deliveries based on material

    Hi Team ,
    I need one help from you regarding the MB 56 transaction.
    My doubt is : How to get the all process orders and outbound deliveries based on material, plant and batch?
    Please help me regarding this.
    Thanks & Regards,
    Srikanth.

    Hi,
    You can use ST05,to trace the program and find out,
    hope it will help you...
    thanks and regards,
    veera.

  • How do i have CC on home and work computer with same account?

    How do i have CC on home and work computer with same account?

    Hi Markofm,
    You may install software on up to two computers. These two computers can be Windows, Mac OS, or one each.
    If you install on a third computer, it will request you to De-activate on the other two computers.  You can then reactivate one of the previous two computers, and use Creative Cloud apps on it.
    If you regularly need to use the Creative Cloud on more than two computers then it would be best to purchase an additional subscription.  This is the same licensing between which we have for our perpetual product.  An advantage though for Creative Cloud over the perpetual product is that you can install on Mac and Windows with the same subscription!
    Thanks & Regards,
    Sanjeeta

  • How to create an array of JButtons and How to implment it ...

    This is what i want to do - I want to create an array of JButtons that has 8 rows of 8 buttons, could someone help me with this (im creating a checkers board) all i need is the array of buttons and them in 8 rows of 8 buttons .... im pretty confident in the way of making them do what i want but need help getting it up and running .... please note it is to be done in the swing environment and not in a applet or anything - ie in a JPanel and a JFrame .... any help would be GREATLY appreciated.

    U can try this
            JButton b[][] = new Button[8][8];
         setLayout(new YourLayout());
         for(int i =0; i<8; i++)
              for(int j =0; j<8; j++)
                   b[i][j] = new Button("Test");
                   b[i][j].addActionListener(new YourAction());
                   add(b[i][j]);
         }               

  • How can I get my iPhone 4s and my computer to sync an msn email account?

    I had a Blackberry before my IPhone.  On the BB, when I read an email received using my Windows Live account (@msn.com), which I also use as my default email on my Mac, I was asked if I wanted to delete the message from my phone only, my computer only, or from both.  The msn is a pop account.  Now that I have my IPhone, I can not get my phone email and my computer email to sync the same way.  I understand, from an hour on the phone with Apple support, that an imap account will work that way--ex., my yahoo acount.  When I delete a message from my IPhone it also deletes from my yahoo account.  However, I don't often check that account because we use the msn account for the majority of emails and the msn is set up in the computer's mail account.   I was told that because it is a pop account there is possibly no way to make them sync that way.  I wonder if anyone else has run across this issue and if there is any solution at all?  Is it possible to set up an msn.com account using imap on my computer?

    Perhaps you should try using "shared photo stream", if the other phone can view the stream?
    http://support.apple.com/kb/TI104
    HTH

  • How to filter an array with a string value

    I want to filter out all Strings in an array that don't have a certain value in them aka. I want only to see values that start with b or bi or bit etc...
    How can I accomplish this?
    Thanks

    This is another one of those things where I'm surprised it's not in the JDK. It's needed sufficiently frequently, and other languages (esp. scripting languages) seem to support this thing commonly.
    Anyway...when I need something like this (that seems as though many others need it as well and it ought to be in the JDK but isn't), the first thing I do is check Apache Jakarta Commons to see if someone has already written such a thing in a reasonably well-supported toolkit. It's worth a look.

  • How to create an array with controls and indicators?

    I want to create a scrollable array of control/indicator pairs from a config file.  Something that looks like the attached image.  Of course, I can only create an array that's either either a control or indicator -- not both (the operator should not be able to edit the name or change the state of the LED).  So I guess I need to split the array and have two side-by-side and SOMEHOW link the scrollbars.  But then I have no idea how I can get the control switch states from the array.  Is there an easier way to do what I'm trying to do?
    Attachments:
    New Bitmap Image.JPG ‏11 KB

    Hello,
    Another option would be to use the custom control I built for you, see below.  You can just drop this into an array, it should look like your example (more or less).
    Cheers!
    CLA, CLED, CTD,CPI, LabVIEW Champion
    Platinum Alliance Partner
    Senior Engineer
    Using LV 2013, 2012
    Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
    Attachments:
    Custom Switch.ctl ‏8 KB

  • How to plot mutiple arrays on right and left y axes?

    Hi everyone,
    I have a (hopefully small?) problem... I have a 2D array with 6 columns of data I need to plot on a graph... I would like array 0 to plot on the left axis and arrays 1-5 to plot using the left axis... I have tried using clusters to group both sets of data wired to a for loop for each axis... But this is not working... Can't seem to find anything online to help with this..
    Any suggestions would be greatly appreciated.
    Regards,
    Jack
    Solved!
    Go to Solution.

    Not to worry.... Found this link..
    http://digital.ni.com/public.nsf/allkb/049C7E362BE​4270A8625756E005CC46F
    Thanks for vewing...
    Regards,
    Jack

  • How to use the lcds in flex and how use the messageing serviecs in blazeds ?

    I have a problem with messageing servies in Blazeds i used the romte and proxy very well but messaging services ?

    Hi
    Dont know, you dont say which commercial video conference software is involved.
    Tony

  • Sharing an array between flex and php

    please provide some easy methods because i am new to
    php.

    please provide some easy methods because i am new to
    php.

  • How do I back up a second and third computer?

    I just bought a new Macbook and the Apple Time Capsule 1 TB. The Macbook came with Time Machine software aready installed and I was able to easily connect and back up the Macbook no problem. Just the click of a button and off it went.
    I have now installed the Time Capsule software that came with the Time Capsule device on my wife's iBook G4 and on an IBM Thinkpad with Windows XP. But there is no easy-to-use Time Machine software interface like the one that came pre-installed on my MacBook. The Time Capsule I see on these two computers, but not Time Machine interface. How do I start backing up these two computers to the Time Capsule with out the Time Machine interface? What is the process step by step because I cannot seem to figure it out.
    Thanks -
    Nick

    Time Machine is native to Leopard only.
    For the iBook G4 (is it running pre-Leopard?), you can upgrade to Leopard and run Time Machine. If this isn't desired, any Mac back up software able to back up to a NAS is fine (e.g. SuperDuper!, Carbon Copy Cloner, etc...).
    For the ThinkPad, you need to purchase an XP-based back up app (e.g. Acronis True Image, Norton Ghost) or one that allows backups to a NAS.

  • How to find purchased apps - Stolen iPhone and New Computer

    I got a new iPhone 3gs, but had a broken laptop at the time. I set up iTunes on the phone and went on holiday. Whilst on holiday, my iPhone was stolen. Now I am back, my laptop is fixed (but had to be completely wiped and so iTunes and apps lost), and I have just received my replacement iPhone.
    I have downloaded iTunes, and put in my iTunes login, and was hoping my apps would magically appear, but they don't seem to be anywhere.
    I'm worried that because my iPhone was not plugged into my computer after downloading the apps and before losing the phone, I have lost them completely, and some of them were quite pricey and I downloaded loads.
    Any advice appreciated, or should I just cut my losses and give up trying and just start again?

    Log into iTunes, view your account and *Purchase history* to see what you have purchased.
    You can redownload Apps for free.

  • How do i move itune songs from an old computer to a new one?

    How do I move itune songs from and old computer no longer used to a new one?

    http://support.apple.com/kb/HT3819
    or
    http://support.apple.com/kb/HT1751

  • How to filter array of file-names?

    Hi everybody,
    I'm trying to populate a list with files of a specific file type and then import the selection from my list into my current AE project. I've got a folder with many subfolders. So far I only managed to check through all the folders by using David Tornos solution form here:
    Working with system folders and files
    Now I have an array with all files in the subfolders. How can I filter that array to only show files with specific filename extensions, e.g. .jpg?
    The folderObj.getFiles function has a convenient mask with which this is possible. Is there anything similar for an array?
    Regards, Michael

    You can check that the file is a jpeg exactly as my previous post, using a regexp.
    The code below should work (i didnt test it):
    function scoutFolder(folder, f, recursive){
        // executes the function f (handler) on every file of "folder" and if recursive evaluates to true, recurses through subfolders until bottom is reached
        var files=folder.getFiles();
        var n, N=files.length;
        for (n=0; n<N; n++){
            f(files[n]);
            if (recursive && files[n] instanceof Folder) scoutFolder(files[n], f, recursive);
        return;
    var myFolder = Folder(/*your input*/);
    var recursive = true;
    var jpgImages = [];
    var reg = /\.(jpeg|jpg)$/;
    scoutFolder(myFolder, function(file){if (reg.test(file)) jpgImages.push(file);}, recursive);
    // at this stage, the "jpgImages" array should contain all jpg files in the folder
    Xavier.

Maybe you are looking for

  • Office 2013 preview error - There was a problem sending the command to the program

    When I launch excel from a document on my desktop I get the above error. I can launch excel directly and find the document and open it with no problems but not directly from the link

  • Upgrading to 6.1 from 4.1

    I am buying two new 7825s to replace my current 7825s and have ESW/UCSS. I am wondering if CM6.1-K9-MIG0= is needed even though I have the smartnet coverage?

  • Laptop like ibook clamshell

    okay so i know you guys released that colorful laptop back in 1999 called the ibook clamshell g3, and yeah i know it has horrible hardware and stuff.  So right now, I was wondering if there is any laptops out there like that one that have like the tr

  • ADDDITIVE COST FOR PRODUCT COST BY SALES ORDER SCENARIO.

    Dear friends, We are using costing for sales order & we have maintained the costing variant under the path IMG> Controlling> Product Cost Controlling> cost object controlling> Product cost by sales order >premliminary costing & order based costing>pr

  • Blackberry messenger (BBM)

    i have had bbm for years now but this morning all my messages would not send it came up with a red "x", so i turned my phone off and back on and there was still no joy,left it for abit and it wouldnt work,so i wiped my phone and set everything up aga