Merge XY data from two worksheets based on X values
Minimum Origin Version Required: 8.0 SR5
1. wmergexy iy:=(1,2) oy:=(3,4)
2. wmergexy iy:=sheet1!(1,2) oy:=sheet2!(1,2) label:=L
Please refer to the page for additional option switches when accessing the x-function from script
Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
---|---|---|---|---|
Input | iy |
Input XYRange |
|
Specify the XY range to copy |
Output | oy |
Input/Output XYRange |
|
Specify the destination for the copied data |
Labels to Copy | label |
Input string |
|
Specify which column label to copy. This is a string following the same convention as in wks.Labels. For example, label:=L will copy Long Name, label:=LC will copy Long name and Comments. |
This X-Function is used to merge XY data according to the X values.
For each row in the input range, the X-Function looks at the output range and see if an equal X value exists. If no equal X value is found, copy this row to the output range. Otherwise, replace the Y value that corresponds to the X value in the output range with the Y value in this row.
You can also copy row labels from the input range to the output range at the same time.
There are XY data in two worksheets, and you want to combine all the data into one worksheet. The datasets do not have common any X values.
Suppose the datasets are already in Origin workbooks like below:
You can perform the following steps to combine them:
Two worksheets have been combined. Also, the Long names have been copied.