cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP Security Notice: CVE-2026-109618 and CVE-2026-109619

    JMP promptly initiated a review of its products, services, and relevant infrastructure for exposure to CVE-2026-109618 and CVE-2026-109619.

    Our assessment of JMP products has not identified exposure to these vulnerabilities. Where remediation was required within supporting environments, appropriate security updates and controls have been applied and validated.

    We have identified no evidence of successful exploitation or unauthorized access to JMP systems or customer information associated with these vulnerabilities.

    JMP continues to monitor the issue and relevant vendor guidance. No action is required by JMP customers at this time.

  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
ehchandlerjr
Level V

Use a variable number of columns to join data tables

Hello - I'm trying to do a join as part of a script. However, the "select" and "selectwith" parts are messing me up. I'm dynamically selecting columns of linked data tables earlier in the script, and and passing them as a list to the "select" and "select with" parts. I tried Eval(Eval Expr(Expr())), but that didn't work. I think I'm just misunderstanding the way those two actually take information.

 

Data Table(dt2b) << Join(
    With(Data Table("Experimental Info")),
    Match Flag(1),
    Select(selectedCols1String),
    SelectWith(selectedCols2String),
    By Matching Columns(:ID = :ID),
    Drop multiples(0, 0),
    Include Nonmatches(0, 0),
    Preserve main table order(1)
);

The output for selectedCols1String and selectedCols2String look like this: ":ID, :2Theta, :Data, :Error, :Raw Data, :Raw Error"

 

Thanks!

Edward Hamer Chandler, Jr.
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Use a variable number of columns to join data tables

You shouldn't use a string but rather a list and use Eval with it

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Trial1.jmp");
dt2 = Open("$SAMPLE_DATA/Little.jmp");

select_cols = {"popcorn", "oil amt", "batch", "yield"};
with_cols = {"yield", "batch"};

dt3 = dt << Join(
	With(dt2),
	Select(Eval(select_cols)),
	SelectWith(Eval(with_cols)),
	By Matching Columns(:popcorn = :popcorn, :batch = :batch, :oil amt = :oil)
);

Here I'm using list of strings, but those could be list references also

View more...
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Trial1.jmp");
dt2 = Open("$SAMPLE_DATA/Little.jmp");

select_cols = {:popcorn, :oil amt, :batch, :yield};
with_cols = {:yield, :batch};

dt3 = dt << Join(
	With(dt2),
	Select(Eval(select_cols)),
	SelectWith(Eval(with_cols)),
	By Matching Columns(:popcorn = :popcorn, :batch = :batch, :oil amt = :oil)
);
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Use a variable number of columns to join data tables

You shouldn't use a string but rather a list and use Eval with it

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Trial1.jmp");
dt2 = Open("$SAMPLE_DATA/Little.jmp");

select_cols = {"popcorn", "oil amt", "batch", "yield"};
with_cols = {"yield", "batch"};

dt3 = dt << Join(
	With(dt2),
	Select(Eval(select_cols)),
	SelectWith(Eval(with_cols)),
	By Matching Columns(:popcorn = :popcorn, :batch = :batch, :oil amt = :oil)
);

Here I'm using list of strings, but those could be list references also

View more...
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Trial1.jmp");
dt2 = Open("$SAMPLE_DATA/Little.jmp");

select_cols = {:popcorn, :oil amt, :batch, :yield};
with_cols = {:yield, :batch};

dt3 = dt << Join(
	With(dt2),
	Select(Eval(select_cols)),
	SelectWith(Eval(with_cols)),
	By Matching Columns(:popcorn = :popcorn, :batch = :batch, :oil amt = :oil)
);
-Jarmo
ehchandlerjr
Level V

Re: Use a variable number of columns to join data tables

Thank you so much! 

Edward Hamer Chandler, Jr.

Recommended Articles