BookmarkSubscribe
Choose Language Hide Translation Bar

How can I judge value cell and modify it in JMP script?

Sorry! I’m a beginner in JSL.


I want to judge value of cell it will be deleted if it was not I want in cell.


Such as : if( {column[4] ,row[5]} =1 , column[4],row[5]->will be deleted) ,


How can I do?

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: How can I judge value cell and modify it in JMP script?

Chris,

If you want to test a cell value and then delete the cell value you can use something like this:

dt = current data table();

for (i = 1, i <= nrows(dt), i++,  // Loop over all column 4 values
    if (column(4)[i] == 1,

    // then

        column(4)[i] = .; // Numeric "null"

    );

);

0 Kudos
4 REPLIES 4
wiebepo
Community Trekker

Re: How can I judge value cell and modify it in JMP script?

There are a number of ways to use criteria to delete rows. Here is a solution to the example shown:

::data_table=currentdatatable();

If(column(::data_table,4)[5]==1, ::data_table<<deleterows(5));

0 Kudos
pmroz
Super User

Re: How can I judge value cell and modify it in JMP script?

Chris,

If you want to test a cell value and then delete the cell value you can use something like this:

dt = current data table();

for (i = 1, i <= nrows(dt), i++,  // Loop over all column 4 values
    if (column(4)[i] == 1,

    // then

        column(4)[i] = .; // Numeric "null"

    );

);

0 Kudos

Re: How can I judge value cell and modify it in JMP script?

Thank you for your answer

You help me solve a knotty trouble.

0 Kudos
gbu
gbu
Community Trekker

Re: How can I judge value cell and modify it in JMP script?

Maybe something like this :

RowsToDelete = dt << Get Rows Where(:COLUMN_NAME = 4);

dt << Delete Rows(RowsToDelete);

Regards,

Guillaume

0 Kudos