- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
For loop -- delete row and formula in list
Hi all,
How can I iterate a delete formula then delete column using for loop in list?
Something like this:
col_formula = {"Column1", "Column2" };
col2_row = {"Column3", "Column4"};
For( i = 1, i <= N Items ( col_formula ), i++,
col_formula (i) << Delete Formula //delete formula
col2_row (i) << Delete Row//delete row
);
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: For loop -- delete row and formula in list
Created:
Sep 19, 2022 10:15 PM
| Last Modified: Sep 19, 2022 7:17 PM
(1136 views)
| Posted in reply to message from UserID16644 09-19-2022
col_formula = {"Column1", "Column2"};
col2_row = {"Column3", "Column4"};
// This will delete the formula
For( i = 1, i <= N Items( col_formula ), i++,
Column( col_formula[i] ) << Delete Formula; //delete formula
);
// You cannot delete a row within a given column. JMP always has
// an equal number of rows for all columns.
// You can delete a row, but it will delete the row for all columns.
current data table() << delete rows( i );
// If you want to remove the value for a given row within a column,
// you can set the value to a missing value
Jim
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: For loop -- delete row and formula in list
Hi
I thick this should be work expect your column format might incorrect.
cols={":col_1",":col_2"};
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Bank Loan.jmp" );
:Time << Delete Formula;
心若止水
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: For loop -- delete row and formula in list
Created:
Sep 19, 2022 10:15 PM
| Last Modified: Sep 19, 2022 7:17 PM
(1137 views)
| Posted in reply to message from UserID16644 09-19-2022
col_formula = {"Column1", "Column2"};
col2_row = {"Column3", "Column4"};
// This will delete the formula
For( i = 1, i <= N Items( col_formula ), i++,
Column( col_formula[i] ) << Delete Formula; //delete formula
);
// You cannot delete a row within a given column. JMP always has
// an equal number of rows for all columns.
// You can delete a row, but it will delete the row for all columns.
current data table() << delete rows( i );
// If you want to remove the value for a given row within a column,
// you can set the value to a missing value
Jim