Subscribe Bookmark RSS Feed

Re: Join - This should be simple

Hegedus

Community Trekker

Joined:

Jun 23, 2011

OK.

DT1 has 1 column on interest named DUT#

DT2 has a variable number of columns.

I want to script a join that takes all the columns on DT2 and joins it with the single DUT# column in data table 1 by using Row numbers.

What is Select and selectwith expecting, a list, a string, .... "A pretty please"

How do I script this ?  The manual is completely worthless.

Current Data Table( CT );

ListofPads = CT << get column names;

CT1 = Data Table( CT ) << Join( With( Data Table( DUTTable ) ),select(ListofPads),selectwith(:DUT#), By Row Number);

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Try to put the column list within Eval():

..., select(Eval(ListofPads)),...

8 REPLIES
vince_faller

Super User

Joined:

Mar 17, 2015

Let JMP make the script for you.  Just join the table and select source on the output table. 

Data Table( "Untitled" ) << Join(

  With( Data Table( "Untitled 2" ) ),

  By Row Number

)

Hegedus

Community Trekker

Joined:

Jun 23, 2011

This approach does not work.

The script produced by JMP has specific column names and as such is not flexible to a different set of names or number of columns.

Solution

Try to put the column list within Eval():

..., select(Eval(ListofPads)),...

Highlighted
Hegedus

Community Trekker

Joined:

Jun 23, 2011

Thank you that worked.

Broader question, where in the documentation would it explain that that was necessary?

vince_faller

Super User

Joined:

Mar 17, 2015

If DT1 only has 1 column and you're trying to join all the columns for DT2, why are you selecting columns?  My apologies, I must not have understood your question. 

Hegedus

Community Trekker

Joined:

Jun 23, 2011

In JMP 11 you can't update by row position  so I would have to create and delete rows and in JMP 12 it deletes the data.  I reported the bug.

vince_faller

Super User

Joined:

Mar 17, 2015

You're trying to update?

In Join you just have to change the matching specification.  (In JMP 11.2.1)

8439_3-27-2015 4-07-48 PM.png

chungwei

Staff

Joined:

Jun 23, 2011

You can use the key word "all" in place of the list of columns if you want to include all the columns from one table,

In the following example, I am joining Big Class to untitled 9 by row number.

I want to include only :Column 1 from untitled 9, and all the columns form Big Class.

Data Table( "Big Class" ) << Join(

  With( Data Table( "untitled 9" ) ),

  SelectWith( :Column 1 ),

  Select( all),

  By Row Number

)