Everything goes fine but the update ddata table does not want to replace the original AgencyStayLBL. It ends up as "AgencyStayLBL 2".
Could someone tell me what am I doing wrong please?
dtagencystay = Open( "/Users/..../AgencyStayLBL.jmp" );
dtrealdata = Open( "/Users/.../AgencyStayREALDATA.xls" );
dtagencystay << Join(
With( Data Table( "REALDATA" ) ),
Suppress formula evaluation( 0 ),
By Row Number,
Output Table( "AgencyStayLBL", Replace Table )
dtagencystay << Sort( By( :SalesDate ), Order( Ascending ), Replace Table );
dtagencystay << Select Where( :StayType == 4 );
dtagencystay << delete rows;