- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
columns
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: colonnes
One option using associative arrays
Names Default To Here(1);
dt = Open("$DOWNLOADS/AA.jmp");
// build
aa_duree = Associative Array();
aa_nonduree = Associative Array();
For Each({col_name}, dt << Get Column Names("String"),
If(Word(1, col_name) == "durée",
aa_duree[Word(-1, col_name)] = col_name;
, !IsMissing(Regex(col_name, "\d+")),
aa_nonduree[col_name] = 1;
,
continue()
);
);
aa_duree_copy = aa_duree;
aa_duree_copy << Intersect(aa_nonduree);
cols_to_keep = Insert(aa_duree_copy << get keys, aa_duree_copy << get values);
aa_duree_copy2 = aa_duree;
aa_nonduree_copy = aa_nonduree;
aa_duree_copy2 << remove(aa_nonduree);
aa_nonduree_copy << remove(aa_duree);
cols_to_remove = Insert(aa_nonduree_copy << get keys, aa_duree_copy2 << get values);
show(cols_to_keep, cols_to_remove);
There are also other options, like joining stacked table(s) or using just lists
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: colonnes
Associative array can help when making the intersection Associative Arrays in Set Operations (jmp.com) if you can make the keys look same. Or you could stack the tables, make them look similar and then perform a join. I think the most difficult part might be how you can get those lists of columns you are interested in and this depends on your data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: columns
I aim to remove the columns "duration 721", "730" and "750"
This post originally written in French and has been translated for your convenience. When you reply, it will also be translated back to French .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: colonnes
One option using associative arrays
Names Default To Here(1);
dt = Open("$DOWNLOADS/AA.jmp");
// build
aa_duree = Associative Array();
aa_nonduree = Associative Array();
For Each({col_name}, dt << Get Column Names("String"),
If(Word(1, col_name) == "durée",
aa_duree[Word(-1, col_name)] = col_name;
, !IsMissing(Regex(col_name, "\d+")),
aa_nonduree[col_name] = 1;
,
continue()
);
);
aa_duree_copy = aa_duree;
aa_duree_copy << Intersect(aa_nonduree);
cols_to_keep = Insert(aa_duree_copy << get keys, aa_duree_copy << get values);
aa_duree_copy2 = aa_duree;
aa_nonduree_copy = aa_nonduree;
aa_duree_copy2 << remove(aa_nonduree);
aa_nonduree_copy << remove(aa_duree);
cols_to_remove = Insert(aa_nonduree_copy << get keys, aa_duree_copy2 << get values);
show(cols_to_keep, cols_to_remove);
There are also other options, like joining stacked table(s) or using just lists
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: columns
This post originally written in French and has been translated for your convenience. When you reply, it will also be translated back to French .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content