Merge XY data from two worksheets based on X values
Minimum Origin Version Required: 8.0 SR5
Command Line Usage
1. wmergexy iy:=(1,2) oy:=(3,4)
2. wmergexy iy:=sheet1!(1,2) oy:=sheet2!(1,2) label:=L
|| Specify the XY range to copy
|| Specify the destination for the copied data
|Labels to Copy
|| 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:
- Enter wmergexy -d in the Command Window to open the dialog box of the X-Function.
- Click the Interactive Range Selector button next to Input and select the columns from the fftfilter1 worksheet. Then click the button to the right of the rolled up dialog box .
- Click the Interactive Range Selector button next to Output and select the columns from the fftfilter2 worksheet. Then click the button to the right of the rolled up dialog box .
- Enter L in the edit box of Labels to Copy.
- Click the OK button and you will get the result:
Two worksheets have been combined. Also, the Long names have been copied.