¡Hola! todo,
Me gustaría encontrar y reemplazar datos que contengan cierto rango de valores en una columna específica usando el script jmp
Sin embargo, el código no surtió efecto.
Aquí está mi código que quiere recorrer los datos en la columna "marcar" y buscar un valor superior a 1000 y sustituirlo por 99
Names Default To Here( 1 );
dt = Data Table( "studentmark" );
headerList = dt << get column names( string );
For( i = 1, i <= N Items( headerList ), i++,
If( Contains(headerList[i], "mark"),
dt << Begin Data Update;
For Each Row( dt, As Column( dt, headerList[i]) = Substitute( As Column( dt, headerList[i]) > 1000 , 99 ));
dt << End Data Update;
);
);
¿Alguien sabe qué salió mal con el código?
Agradezco las ayudas. Gracias
Supongo que desea que todos los valores por encima de 1000 se conviertan a 99, si es así, el siguiente script hará esto de manera más eficiente que usar For Each Row()
Names Default To Here( 1 );
dt = Data Table( "studentmark" );
headerList = dt << get column names( string );
For( i = 1, i <= N Items( headerList ), i++,
If( Contains( headerList[i], "mark" ),
theRows = dt << get rows where( As Column( headerList[i] ) > 1000 );
If( Length( theRows ) > 0,
Column( headerList[i] )[theRows] = 99
);
);
);