cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use to use Text Explorer to glean valuable information from text data at April 25 webinar.
Choose Language Hide Translation Bar
View Original Published Thread

Delete values

hcarr01
Level VI

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:

 

undefined

 

 

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:

 

undefined

 

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 .

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User


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] = .;
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User


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] = .;
-Jarmo
hcarr01
Level VI

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 .