Use an example of this in the figure:
Thanks!
dt = Open( "$SAMPLE_DATA/Big Class.jmp" ); dt[2::8,"height"]=""; dt[10::17,"height"]=""; dt[19::28,"height"]=""; dt[30::39,"height"]=""; New Column("new",Character,"Nominal",Width(5));
names default to here(1); dt = Open( "$SAMPLE_DATA/Big Class.jmp" ); dt[2 :: 8, "height"] = ""; dt[10 :: 17, "height"] = ""; dt[19 :: 28, "height"] = ""; dt[30 :: 39, "height"] = ""; New Column( "new", formula( If( Row() == 1, last = 0 ); If( Is Missing( :height ) == 0, If( last == 0, x = .; last = Row(); , x = Row() - last ); last = Row(); , x = . ); x; ) );
Thank Jim!
I've always used Excel, and these simple data processes are easy.
I don't want to process data through Excel and then use a professional module that USES JMP.Instead, use JMP to handle all of them.
I think JMP can be done with this formula.But know how to write it
Contains(:[Index(1,Row())],,-1)
Parameters such as ">0" do not work in JMP, but excel does.
Contains(:[Index(1,Row())],">0",-1)
Contains(:[Index(1,Row())],!is Missing(:),-1)
I've tried all of them and they don't work.
what are you expecting the results to be with this formula?
Excel is like many languages, including JMP, that have their own unique coding shortcuts. Some of them become more universally used across many languages, but most just stay as unique syntax within their own language. Such syntactical items in JMP are all covered in the Scripting Guide.
Here is another way to do the calculation. It works fine on a small data table, but becomes costly with a lot of rows.
names default to here(1); dt = Open( "$SAMPLE_DATA/Big Class.jmp" ); dt[2 :: 8, "height"] = ""; dt[10 :: 17, "height"] = ""; dt[19 :: 28, "height"] = ""; dt[30 :: 39, "height"] = ""; New Column( "new", formula( If( Is Missing( :height ) == 0, curRow = Row(); x = curRow - Max( Current Data Table() << get rows where( Row() < curRow & Is Missing( :height ) == 0 ) ); , x = . ); x; ) )
I use VBA and often write loops to complete my own projects.I often use more than a few million lines of data.Speed is a key issue.I feel like JMP is faster.
I want to add another column of "new2" to get it to the next qualifying interval.
How can calculate and print both columns ("new", "new2") simultaneously?Like VBA array, in memory um operation, once output to the table.