cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
AnthonyS
Level I

join data table output culumns

hello,

 

i need join with a script 2 data tables and select  output columns for a new data table.

Can you help me ?

 

Best regards,

 

Anthony  

1 ACCEPTED SOLUTION

Accepted Solutions
uday_guntupalli
Level VIII

Re: join data table output culumns

Once you generate the table - there will be a "source" with a green button which looks like this . 

Right click and "Edit" to get the script that JMP generated. 

 

image.png

Best
Uday

View solution in original post

9 REPLIES 9
uday_guntupalli
Level VIII

Re: join data table output culumns

Hello @AnthonyS,
           There are a couple of ways to acheive what you want. 

1. By using the JMP Scripting Language (JSL) 

2. By using the click and point interactive interface in JMP 

 

           I will show how to do both in my response and feel free to ask any questions. 

Approach 1 : 

// Open Sample Data Tables 
dt1 = Open( "$SAMPLE_DATA/Air Traffic.jmp" );

dt2 = Open( "$SAMPLE_DATA/Airline Delays.jmp" );

// Join Tables 
dt3 = dt1 << Join(With(dt2 ),
					Select( :Airline, :Carrier Code, :Flight Number, :Tail Number ),
					SelectWith( :Arrival Delay, :Distance ),
					By Matching Columns( :Airline = :Airline ),
					Drop multiples( 1, 1 ),
					Include Nonmatches( 0, 0 ),
					Preserve main table order( 1 )
				 ); 


Approach 2 : 

When you open a data table in JMP, navigate to Tables > Join , when you click on the Join you will see the following screen - this enables you to chose the tables with which you want to perform the join and also allows you to select columns for the joined table. 

 

image.pngimage.png

Best
Uday
AnthonyS
Level I

Re: join data table output culumns

thx

 

My problème in that i need select columns in data table joint (Reference), but the active data table is the last oppenin (Repeatablility).

how i can specify the active data table in the join fonction?

 

my script is in attachment

uday_guntupalli
Level VIII

Re: join data table output culumns

@AnthonyS
        Please look at my previous response. If you were to select interactively , at the end of the Join Platfrom there is an option that allows you to select columns from both tables during the join. The same concept applies if you were scripting.

 

image.png

Best
Uday
AnthonyS
Level I

Re: join data table output culumns

Yes but in your example you select just the "Air Traffic" Columns but i need select  the "Airline Delays" columns too.

 

toto.PNG

uday_guntupalli
Level VIII

Re: join data table output culumns

Which you are able to do - in your screenshot. So your problem is solved.
While my example does not demonstrate selection from "Airline Delays" as long as you are able to do it- I am not sure what other problems you are running into ?

Best
Uday
AnthonyS
Level I

Re: join data table output culumns

in script ^^ 

uday_guntupalli
Level VIII

Re: join data table output culumns

Once you generate the table - there will be a "source" with a green button which looks like this . 

Right click and "Edit" to get the script that JMP generated. 

 

image.png

Best
Uday
txnelson
Super User

Re: join data table output culumns

Does this script help you?

Pre = Open( "Preliminary.jmp" );
Repeat = Open( "Repeatability.jmp" );

Ref = Repeat << join(
	With( Pre ),
	Output Table Name( "Reference" ),
	Select(
		"SampleID-W",
		"Repeatability MEAN_BRIDGE_RATIO"
	)
);
Jim
AnthonyS
Level I

Re: join data table output culumns

Thx Jim, 

 

but i already tried this script unsuccessful.