find is missing start from column X till ncol()Hi,
I have a table that has thousand of columns. I want to use column matrix to find if across a range of columns is missing.
I first identify the starting of the first column number using Loc().
allcol = dt << get column names(string);
colname = column ("starting column") << getname;
colnumber = (Loc(allcol ,colname))[1];
then I want to find if the columns from colnumber till ncol() is missing. something like below but it failed. can someone point me how I can make it right ?
dt << select where (ismissing(column()[colnumber :: ncol()]))
Automation and ScriptingRe: find is missing start from column X till ncol()Here is an example of finding rows that have missing values within a range of columns for each row.
Names Default To Here( 1 );
dt =
// Open Data Table: semiconductor capability.jmp
// → Data Table( "semiconductor capability" )
Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
// for example purposes set some random cells to missing values
For( i = 1, i <= Random Integer( 1, 100 ), i++,
random row = Random Integer( 1, 1455 );
random col = Random Integer( 5, 132 );
dt[random row, random col] = .;
);
starting colName = "NPN1";
allcol = dt << get column names( string );
starting col = Contains( allcol, starting colName );
rowsWithMissing = [];
For Each Row(
mat = dt[Row(), starting col :: N Col( dt )];
If( Length( Loc( mat, . ) ) > 0,
rowsWithMissing = rowsWithMissing || matrix(row());
);
);
show(rowsWithMissing);