The following code assumes input book is Book1 and output into another book named Book2
//assume data in book1 and result in book2
dataset xx;
int ncrossing;
int nout;
range xout=[book2]1!1;
range myBook=[book1];
nout = 1;
for(int ns=1; ns<=myBook.nLayers;ns++)
{
range mydata=[book1]$(ns)!(1,2);//assume XY
levelcrossing iy:=mydata nc:=nn oy:=xx;
if(nn>0) //has at least one crossing, get the first
{
xout[nout]=xx[1];
nout++;
}
}
give it a try, if does not work, maybe your Origin is too old, try the demo Origin 2016.
CP