Merging 2 datasources at Array level

I am trying to merge 2 data sources into 1 to be used as a
data provider for an AdvancedDataGrid:
Originally I have this for a single data source:
var dsrc:Array = new Array();
dsrc.push({col1:val1,col2:val2});
dsrc.push({col1:val3,col2:val4});
Now I have a second data source that I am trying to merge. So
I want the final array to look like this:
var dsrc:Array = new Array();
dsrc.push({col1:val1,col2:val2, col3:val5, col4:val6});
dsrc.push({col1:val3,col2:val4, col3:val7, col4:val8});
I tried doing this ... it compiles but it doesn't work as
expected:
var dsrc:Array = new Array();
var temp1:Array = new Array();
temp1.push({col1:val1});
temp1.push({col2:val2});
temp1.push({col3:val5});
temp1.push({col4:val6});
dsrc.push(temp1);
var temp2:Array = new Array();
temp2.push({col1:val3});
temp2.push({col2:val4});
temp2.push({col3:val7});
temp2.push({col4:val8});
dsrc.push(temp2);
Is there a proper way to merge these two?
Thanks,
EE

Maybe you could try it with an ArrayCollection? Like this
example:

Similar Messages

  • How to merge two DataSources?

    Hi all!
    I'm trying to merge 2 dataSource into 1. I'm using createMergingDataSource() method, but it didn't work and I've 2 questions:
    - Does this method mix the DataSources or only concatenate it?
    - I don't know if I'm doing the right steps. Does anybody know it?
    Thanks in advance! :D

    Hi Captfoss!
    I tried to send two SendStream on the same RTPManager but I didn't work. Because When I receive this stream in other computer the sound is not good. Any idea? I tried to merged the dataSources previously too, but It seem to send only one.
    On other way, you said me that I was creating the sendStream bad, because of the index. The process to create a SendStream is this:
    outputDS = (DataSource) outputProcessor.getDataOutput();               
    outputProcessor.start();
    sendStream = RTPmanager.createSendStream(outputProcessor.getDataOutput(),0);          
    sendStream.start(); You told me that I should use the index 1, but when I tried that It throws me a NullPointerException. Any idea??
    Thank you very much!:D

  • Merging labview and mathscript array question tia sal2

    Greetings,
    I really like mathscript functionality it’s just taking a
    while to learn how to merge labview and mathscript together.  I can get an XY graph out which plots the
    correct wave function (thanks to the forums help) the problem is going from 1-D
    Array of cluster 2 elements to 1-D of waveform Double so I can get a sound representation
    of the waveform. 
    Anyone have any suggestions.
    Tia sal2
    Attachments:
    mathscript formula to sound with waveform graph.vi ‏248 KB

    Sorry not sure what happened internet gremlins maybe...here's the vi and graphic image
    Second try Hopefully this will work
    Attachments:
    mathscript formula waveform graph.vi ‏1 KB
    image_of_mathscript_to_labview.jpg ‏108 KB

  • CF10 Datasources and Isolation Level

    I've been looking all over for a solution to this and have been unable to find one.  In CF9 using jrun, we are able to set the default isolation level on a datasource so that any time it is used it defaults to dirty read in case a record is in a lock state it still returns the current data.  However in CF10 with it using Tomcat, I cannot find anyway to even configure a datasource through Tomcat, or set the default isolation level on a datasource created in the CF10 administration panel.  I know we could surround every single query with a <cftransaction> tag that sets the isolation level, but that is unrealistic as this is a very large web service with thousands of queries.
    Can anyone help out with this?  Thanks!

    Hello
    You should be able to see your inserted row in the same session
    Session 1:_
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL> SELECT *  FROM demo;
            ID
            11
             1
             2
             3
             4
             5
             8
             9
            10
    9 rows selected.
    SQL>
    SQL> INSERT INTO demo  VALUES (11);
    1 row created.
    SQL>
    SQL> SELECT *   FROM demo;
            ID
            11
             1
             2
             3
             4
             5
             8
             9
            10
            11
    10 rows selected.
    Session 2: Different session without committing the result from the above session_
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
    SQL> select * from demo;
            ID
            11
             1
             2
             3
             4
             5
             8
             9
            10
    9 rows selected.Regards
    Edited by: OrionNet on Jan 4, 2009 9:58 PM

  • Please help---merge function for two arrays.

    I am trying to create a merge function that merges two sorted arrays into a third array. I know what I am supposed to do, at least in theory, but I have been completely unsuccessful with actually getting the code to work. Since it is private, you can't directly access the arrays, you have to just reference them. could someone please help me out.
    import java.io.*;
    class OrdArray
    private long[] a;
    private int nElms;
    public OrdArray(int max)
    a = new long[max];
    nElms = 0;
    public int size()
    { return nElms;}
    public int find(long searchKey)
    int lowerBound = 0;
    int upperBound = nElms-1;
    int curIn;
    while(true)
    curIn = (lowerBound + upperBound) / 2;
    if(a[curIn]==searchKey)
    return curIn;
    else if (lowerBound > upperBound)
    return nElms;
    else
    if(a[curIn] < searchKey)
    lowerBound = curIn + 1;
    else
    upperBound = curIn - 1;
    public void insert(long value)
    int j;
    for(j=0; j<nElms; j++)
    if(a[j] > value)
    break;
    for(int k=nElms; k>j; k--)
    a[k] = a[k-1];
    a[j] = value;
    nElms++;
    public boolean delete(long value)
    int j = find(value);
    if(j==nElms)
    return false;
    else
    for(int k=j; k<nElms; k++)
    a[k] = a[k+1];
    nElms--;
    return true;
    public void display()
    for(int j=0; j<nElms; j++)
    System.out.print(a[j] + " ");
    System.out.println("");
    public void merge(OrdArray array, OrdArray array1)
    }//this is the start of the merge function. I am stuck and not real sure where to go from here.
    public long getElm(int index)
    return a[index];
    }//end class OrdArray
    class OrderedApp
    public static void main(String[]args)
    int maxSize = 100;
    OrdArray arr, arr1, arr2;
    arr = new OrdArray(maxSize);
    arr1 = new OrdArray(maxSize);
    arr2 = new OrdArray(maxSize);
    arr.insert(77);
    arr.insert(99);
    arr.insert(44);
    arr.insert(55);
    arr.insert(22);
    arr1.insert(88);
    arr1.insert(11);
    arr1.insert(00);
    arr1.insert(66);
    arr1.insert(33);
    arr2.merge(arr, arr1);
    arr.display();
    System.out.println("--------------------");
    arr1.display();
    System.out.println("--------------------");
    arr2.display();
    }

    If I use ArrayList<Long>, would I have to change private long[]a to ArrayList<long>, cause if so, I am not able to do that.
    I am supposed to add a merge() method to megre the two source arrays into an ordered destination array.
    public void merge(OrdArray array, OrdArray array1)
    mergeSize = array.nElems + array1.nElems;
    int i = 0;
    int j = 0;
    int k = 0;
    while (i = 0; i < array.nElems; i++) {
              if {array.getElm(i) < array1.getElm(j)
                                                              //how do you move to the next set of values
                                                              //and to move which variables are incremented
                                                              //how do you test if the flush loop should be      called, hint if( == )
                   while (j = mergeSize - array.nElems; j <= mergeSize; j++) { 
                                   this.a[j] = array1.a;
    //again how do you move to next value and placeholder
         //which indices are incremented
    //copy/paste and change the variables for the other value being smaller
    public long getElm(int index)
    return a[index];
    this is all I have started, but i don't really understand all the comments because I haven't used java in a long time. Like I said, I understand what needs to be done and what order to do it in, but getting the code down to do that is really rough

  • Merge - 2nd Level Navigation

    Hi there
    Would really appreciate it if someone out there can put me out my misery.
    Here follows the problem ...
    The requirement on this project is to have really fine control over which reports users are shown. To this end, reports (iviews) are assigned to roles. Users are then assigned to the relevant role to give them access to the required reports.
    In terms of the menu structure, many roles make up a menu. In order to not display menu items to which a user has not been assigned, we have gone with the merging approach.
    Anyone out there know how to merge on the second level of navigation?
    R1 = required top level tab
    R2A, R2B = required second level tabs
    R3A1, R3A2, R2B1, R2B2 = required detailed navigation items, each with their own structures defined with worksets
    At the moment, R2A and R2B are assigned as delta links to R1.
    R3A1 and R3A2 have the same mergeID as R2A. R2A has the lowest merge priority.
    Similarly, R3B1 and R3B2 have the same mergeID as R2B.
    For now, the test user is assigned to all the roles above, just so that I can see if the merging works.
    The theory goes that if this works, I can assign the user to the relevant R3? roles and they will then only see what they are supposed to see.
    All I see however, is R1, with R2A and R2B on the second level, but none of the lower roles pull through to the detailed navigation.
    If I set R2A and / or R2B to be entry points, then they show as a top level tab, and the R3B1 and R3B2 roles are merged correctly underneath.
    If I make them not entry points, then I don't get any merging.
    Any ideas ... anyone follow what I am saying ... very difficult to explain this in text without drawings
    Cheers,
    Andrew

    Andrew, Steve and Selvaraj,
    Here is my work around. It's not easy to maintain, but it fulfills the requirement..
    We can only merge roles appropriately in the 1st level, when we make them entry points right? If we add them to another role as delta link, whether they have inner role or not they see the roles content. Also we dont want their content to be seen in the second level.
    My solution is again merging them in the first level and make them entry points with lower merge priority then our original entry point. However add our second level roles one folder with the same name and merge them with the 1st level role with the same id and make entry point.
    The result is
    My job
    ---My applications
    App 1
    App 2
    Now the roles
    roleMyApps : mergeID=mergeApps Entry point, priority:1
    roleSalesPerson mergeID=mergeApps Entry point, priority:5, containing a folder named (my applications) * its the trick, and under it your original content.
    roleFinancePerson mergeID=mergeApps Entry point, priority:5, containing a folder named (my applications) *, and under it your original content.
    You can also use worksets rather then folders but I didn't try it.
    Let me know if it helps, and reward helpful answers.
    Regards,
    Bar&#305;&#351;

  • Merging elements of array

    Hi,
    I am new to programming.
    I have a sensor that sends a data stream through a serial port. I have collect all that data in a 1D unsigned byte array. Now, lets say my 1-D array is [12][45][65][12]...... where each "[ ]"  is a element of the array. Now to make sense of this data what i need to do is merge two elements the array and multipy it by 2/(2^15). i.e. My converted data should by [1245]*2/(2^15). Basically 2 bytes together makes sense. I can do a simple add of each element. Also the other problem is,data from the sensor is a stored as the 1-D array  of unsigned byte. However, the converted data is supposed to be signed 16-bit integer.
    Please give any suggestions on how to go about doing this.
    Siddhant Shah

    Another option is "decimate&Join". (Here it is easy to change the byte order if needed).
    Message Edited by altenbach on 12-15-2008 06:28 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    8bitTo16BitByteOrder.png ‏5 KB

  • Question on merging datasource

    Can I merge two datasources into one?
    One is video datasource from webcam and the other is audio datasource from mic.
    If I can not merge them, does it mean I have to create two processors to play?

    I've done it, but I've got another problem now.
    When I want to record a data source combining audio from mic and video from web cam to data sink, it throws a NoDataSinkException that cannot find a datasink for: com.sun.media.mulitplexer....

  • Evaluate, Time Sync, and merge 2 arrays into 1

    I have two separate text files I am reading in to be processed within
    Labview. I read these two files in and convert them each into 2D
    arrays. What I need to do is to evaluate these files and syncronize
    times which are in the first column line by line. If they are
    syncronized then I need to merge them into one array. Here is an
    example of where I am at.
    1st array
    20-Feb-04 10:23:02 32.543 54.654
    20-Feb-04 10:24:04 33.564 34.765
    2nd array
    20-Feb-04 10:23:57 45.543 24.654
    20-Feb-04 10:24:56 71.564 22.765
    How can I do this? I am sure there is some simple solution, I just
    can't find it. The other thing that I need to do is this. Sometimes
    the
    times match in the same column, but are just off by the seconds.
    Here is an example:
    20-Feb-04 10:23:04 45.543 24.654
    20-Feb-04 10:23:54 71.564 22.765
    I need to throw out the second one. Basically I need to ignore the
    seconds and just look at the hour and minute. I am trying to figure
    out if I simply can evaluate each file, look for duplicates and delete
    the second one, or compare them against each other. Any help would be
    appreciated. Here are the files also to show you what I have thus
    far.
    Attachments:
    Merge1.vi ‏61 KB
    log.txt ‏26 KB
    Velocity1Test.txt ‏16 KB

    Hello,
    I quickly created an .llb that contains the vi's you would need to perform these operations. From your description above, I took the two arrays that you have created, removed duplicates (hour/minute matching), and then appended the data from the second array to the corresponding data in the first array, based on the time stamp. I have included comments in these vi's to help you understand the algorithms I used. Also, in order to do the time stamp comparison, I just took the two times as strings, removed the seconds, and compared those values. I hope this helps. Let me know if you have any more questions! Good luck!
    Jeremy L.
    National Instruments
    Jeremy L.
    National Instruments
    Attachments:
    Merge_Data.llb ‏93 KB

  • Merge arrays of integers

    Hi,
    I hope someone can help me with a method which merges two arrays of intgers. The main idea is to
    divide a array into two almost exact lenghts, sort those arrays and then merge the two sorted arrays.

    int[] intArray;
    int[] int_Array;
    int lenIntArray=intArray.length;
    int lenInt_Array=int_Array.length;
    //Merged Array with length equal to the sum of arrays to be merged.
    int[] mergedArray=new int[lenIntArray+lenInt_Array];
    //Copy arrays into merged array
    for(int i=0; i<lenIntArray; i++)
    mergedArray=intArray[i];
    for(int i=lenIntArray, j=0; i<lenIntArray+lenInt_Array; i++, j++)
    mergedArray[i]=int_Array[j];

  • Merging  Inventory Data With Other Data

    Dear Experts,
    I have a requirement where in i am trying to combine Inventory Data with data from other datasource (0CO_PC_ACT_05).
    I have designed the Bex query from both the sources. Now i have tried to merge the data at BO level by merging dimesions
    plant and material. It works fine for small data set  but there is performance issue as we have huge inventory data of more than 15 years.
    Kindly suggest me the other methods through which i can merge the data.
    Thanks ,
    Sumit

    Hi! Rajesh,
    The input for Inventory Query is Plant,calender date,storage location, material type.
    For Material Ledger query the input is fiscal year/period and plant.
    I have merged the dimensions Plant and material at BO level.
    Thanks
    Sumit

  • Packaged ColdFusion 9 Datasources not importing to ColdFusion 10 64-bit on another computer

    I installed ColdFusion 10 64-bit on my I new 64-bit work computer. To save time and effort; l decide to use Packaging & Deployment option on ColdFusion 9 32-bit on my old computer to archive all my data sources and deploy on the new server. I selected all the Datasources I wanted to archive (26 of them) without selecting any other settings. The archive file was successfully created and I built the backup file 'C:/Projects/ColdFusion/ColdFusionBak24May2013.car' to copy to my machine. Created achieve file is visible in ColdFusion Archives on my old computer, I can modify it and I deploy it on my old computer but nothing happens when I copy ColdFusionBak24May2013.car file to my new computer and try to deploy it there using ColdFusion 10 64-bit.
    Everything seems to work fine with selecting the file but when I click Deploy Achieve; the process goes through the motion but none of the data sources are added to ColdFusion 10 on the new computer.
    Am I doing something wrong or doesn't ColdFusion 9 (32-bit) Achieve file work on ColdFusion 10 (64-bit)?
    PS: XML file called neo-datasource.xml is located in ColdFusion10\cfusion\lib directory listing all datasources. Would it work if I merge neo-datasource.xml file on my new computer with the one on my old computer instead or not? 
    Any assistance will be greatly appreciated.
    Thank you.

    Have you considered using JDBC rather than ODBC?  I suspect that both Adobe and Microsoft view ODBC as a legacy technology.

  • Saving array data from a waveform chart

    I am using a CRIO 9004 and a 9237 bridge module to measure some strains from strain gauges. I've got one timed loop that reads the DMA FIFO and puts the arrays of values (16 data points, 4 per channel) into a queue. In the consumer timed  loop a For loop scales the binary data, auto indexes it into arrays, then the arrays are merged into a 2D array for the four channels  displayed on a waveform chart . Everytime the consumer loop runs it indexes 4 data points (per channel) yet the waveform chart plots them in a consecutive manner and doesn't overwrite the previous four. If I convert the arrays to waveform arrays I don't see anything on the waveform chart.
    If I pass the 2D array of data to a array indicator inside or outside the consumer loop I get only 16 data points. I want to save the information that appears on the waveform chart  after the consumer loop but because I'm not using waveform data type I can't use the write waveforms to file vi. The waveform chart history buffer has been set to 195360.
    Idealy we will run the four channels for 120 seconds charting the data and saving the data. The minimum data rate is 1613kS/s (403 per channel) The data can be saved after the loops have finished gathering and processing or while they are running. I noticed when I tried to write to TDMS it slowed the consumer down. Same thing if I use a shift register with the volume of data.
    I suspect I'm not sending data to the chart in the correct manner ( usualy takes two attempts to "clear chart" using shortcut menu).  I'm not too familiar with timed loops /producer consumer loops  and just tried to put something together based on examples.
    I've attached my host vi and front panel screenshot.

    Hope they appear attached this time.
    Attachments:
    Basic DMA (Host).vi ‏444 KB
    screenshot2.jpg ‏113 KB

  • Locking in Merge Statement

    Hi All,
    I am using merge statement to insert and update rows. The merge statement takes a row level exclusive lock
    Suppose the select statement returns 1 Million records does
    1) The merge statement first tries to lock all the affected rows and then update / insert records.
    OR
    2) The merge statement aquires lock on an incremental basis as returned by the select statement.

    The merge works just like an insert or update statement in that locks are acquired "on an incremental basis", but as of the timestamp the merge began. When Oracle detects that another session has updated a row in the meantime, then it re-executes the entire merge statement as of that new timestamp. It is sometimes referred to as "write consistency".
    Here is a good Asktom thread on this topic: http://asktom.oracle.com/pls/asktom/f?p=100:11:1694097844551766::::P11_QUESTION_ID:11504247549852
    Regards,
    Rob.

  • Webservices as datasource in OBIEE

    How can we use Webservices as a datasource at RPD level in OBIEE?

    Above solution is basically retrieving the data from OBIEE reports using webservices in the other application but my requirement is just reverse of this which is mention below.
    There is a webservices published by third party which returns following output.
    Brand Amount %Share
    LG     12     10
    SAMSUNG     15     15
    NOKIA     25     25
    RELIANCE 12     12
    Now,the requirement is how can we consume above webservices as a data source in the Repository (RPD Level).

Maybe you are looking for

  • Error in publishing crystal report

    In /crystal/rptadmin I am getting this error when publishing crystal reports <report name> [<technical name>] 0000000004 Item 1 was not found in the collection. Has anyone experienced the same error before?

  • When i open a prodject (open session )I Do not see my mp3  only vocals

    Hi ,Its  been driving me crazy i spend a lot of time trying to get my prodject where i can open it up easy with all my work . when i save it i save it as( save session as)then as a - multitrack ,ses and been importing the beat and trying 2 line up my

  • Sound Booth Crashes, Damaging Source File!!!!

    I spent multiple hours editing a sound file, diligently saving periodically only to have SB crash near the end & ask if I want to save my work before it must shut down. Foolishly, I said yes. It then went into a fatal loop, causing me to resort the t

  • Macbook does not see wireless printer

    My laserjet 1102w is connected to an airport extreme and I can print wirelessly from a windows 7 pc. However, my Macbook Pro does not see the wireless printer. I can print though if I connect the printer directly via USB. When trying to add a printer

  • Black lines at top and bottom of quicktime

    idvd is adding black lines to the top and bottom of my 4:3 quicktime movies... i wouldn't mind so much except that it is adding more at the top than the bottom and looks funny on a regular t.v. screen... any ideas...?