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
zrhelm17
Level I

Join/Update Table Function Help

Hello!

 

I am trying to execute a join (or an update) with columns that are referenced as a variable through a Parse(Eval( "String")) command either internal or external to the join command. I have multiple columns that I aim to match by but only the first set of matches is executing. See syntax below:

 

 

colNamething1 = Eval Insert( ":name(\!"^thing1^\!" )" );
colNamething2 = Eval Insert( ":name(\!"^thing2^\!" )" );

table3 = table1 << Join(
    With( table2 ),
    By Matching Columns(
        Parse( colNamething1 ) = Parse( colNamething1 ),
        Parse( colNamething2 ) = Parse( colNamething2 )
    ),
    Merge Same Name Columns
);

 

When I run the script only colNamething1 is being matched by. I have also tried executing the Parse(Eval Insert("String")) command external to the join and get the same result. Any suggestions on how to get around this? Thanks!

 

-Zac

1 ACCEPTED SOLUTION

Accepted Solutions
ih
Super User (Alumni) ih
Super User (Alumni)

Re: Join/Update Table Function Help

Can you try running the code below?  If this does not give the expected result, can you look in the 'source' script for the resulting table and see if that matches what you expect?

 

I am a little confused by colNamething1 would work in your script but not colNamething2. Maybe JMP is just happening to pick colNamething1 as a default column to join 

 

colNamething1 = "Name 1 As String";
colNamething2 = "Name 2 As String";

Eval( Eval Expr(
	table3 = table1 << Join(
		With( table2 ),
		By Matching Columns(
			Column( Expr( colNamething1 ) ) = Column( Expr( colNamething1 ) ),
			Column( Expr( colNamething2 ) ) = Column( Expr( colNamething2 ) )
		),
		Merge Same Name Columns
	)
) );

View solution in original post

2 REPLIES 2
ih
Super User (Alumni) ih
Super User (Alumni)

Re: Join/Update Table Function Help

Can you try running the code below?  If this does not give the expected result, can you look in the 'source' script for the resulting table and see if that matches what you expect?

 

I am a little confused by colNamething1 would work in your script but not colNamething2. Maybe JMP is just happening to pick colNamething1 as a default column to join 

 

colNamething1 = "Name 1 As String";
colNamething2 = "Name 2 As String";

Eval( Eval Expr(
	table3 = table1 << Join(
		With( table2 ),
		By Matching Columns(
			Column( Expr( colNamething1 ) ) = Column( Expr( colNamething1 ) ),
			Column( Expr( colNamething2 ) ) = Column( Expr( colNamething2 ) )
		),
		Merge Same Name Columns
	)
) );
zrhelm17
Level I

Re: Join/Update Table Function Help

That works! Thank you for the help. Much appreciated!