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
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
A couple of options here:
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"} );
Thanks for the response @txnelson but is there a way to delete, say for example column number 3 in a table?
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
A couple of options here: