- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
How to delete a column after performing join in jsl?
For example,
dte << Join(
With(dtf),
By Matching Column(:Y = :Y ),
Preserve main table order(1),
output table("Joined Table");
);
After I run this script, a new table is generated having the "Y" columns from both the tables, but after joining I want to get rid of those columns. Their names are different every time. For example, "Y of Untitled 50" and "Y of Untitled 51". How do I delete these columns? Thanks
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to delete a column after performing join in jsl?
1. You need to read the Scripting Guide.
Help==>Scripting Guide
It will show you that columns can be referenced by name or by number in most cases.
2. You need to try things on your own,
dtx << delete columns(3);
works just fine
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to delete a column after performing join in jsl?
A couple of options here:
- The Join operation will let you specify which columns to output to the resulting table. That may be easier than trying to clean up afterward. Do the join interactively, selecting the columns to output and then examine the JSL in the Source script for the JSL syntax.
- The Delete Columns() message takes a name or column number.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to delete a column after performing join in jsl?
Here is code that will do it
dtx = dte << Join(
With( dtf ),
By Matching Column( :Y = :Y ),
Preserve main table order( 1 ),
output table( "Joined Table" )
);
dtx << delete columns( {"Y of Untitle 50", "Y of Untitled 51"} );
If you used the "Merge Same Name Columns element in the Join Platform, you can simplify the delete code
dtx = dte << Join(
With( dtf ),
By Matching Column( :Y = :Y ),
Preserve main table order( 1 ),
output table( "Joined Table" ),
Merge same name columns(1)
);
dtx << delete columns( {"Y"} );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to delete a column after performing join in jsl?
Thanks for the response @txnelson but is there a way to delete, say for example column number 3 in a table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to delete a column after performing join in jsl?
1. You need to read the Scripting Guide.
Help==>Scripting Guide
It will show you that columns can be referenced by name or by number in most cases.
2. You need to try things on your own,
dtx << delete columns(3);
works just fine
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to delete a column after performing join in jsl?
A couple of options here:
- The Join operation will let you specify which columns to output to the resulting table. That may be easier than trying to clean up afterward. Do the join interactively, selecting the columns to output and then examine the JSL in the Source script for the JSL syntax.
- The Delete Columns() message takes a name or column number.