- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Delete values
Hello everyone,
I have a database with duplicate values for some columns. The objective is to remove values from a column by assigning the value “.when the previously mentioned columns have duplicate values.
Here is an overview of the database:
For example, on this extract: when there are duplicate cells (task column, batch and op) it would be necessary to be able to assign the value “.(this therefore amounts to deleting the values) in the % Prd, % Proc, % Prd (6months), % Proc (6months) columns.
To get this:
I started with the following script:
Names Default To Here( 1 );
dt = current data table();
// Sélectionner les lignes dupliquées
a = dt << Select Duplicate Rows( Match( :lot, :tache, :op ) );
Column(dt, 11)[a] =.;
Column(dt, 12)[a] =.;
Column(dt, 13)[a] =.;
Column(dt, 14)[a] =.;
Thanks for your help !
This post originally written in French and has been translated for your convenience. When you reply, it will also be translated back to French .
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Supprimer des valeurs
You can use Data table subscripting to replace the values in columns. First get a list of duplicated values (<< Select Duplicate Rows + << Get Selected Rows is one option)
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
columns_to_modify = {"height", "weight"};
dt << Clear Select;
dt << Select Duplicate Rows(Match(:age, :sex));
duplicate_rows = dt << Get Selected Rows;
dt << Clear Select;
wait(1);
dt[duplicate_rows, columns_to_modify] = .;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Supprimer des valeurs
You can use Data table subscripting to replace the values in columns. First get a list of duplicated values (<< Select Duplicate Rows + << Get Selected Rows is one option)
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
columns_to_modify = {"height", "weight"};
dt << Clear Select;
dt << Select Duplicate Rows(Match(:age, :sex));
duplicate_rows = dt << Get Selected Rows;
dt << Clear Select;
wait(1);
dt[duplicate_rows, columns_to_modify] = .;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Delete values
I ended up using both of these functions but without the proper JSL language construct so thank you for your reply!
This post originally written in French and has been translated for your convenience. When you reply, it will also be translated back to French .