<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: join multiple tables from list in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/join-multiple-tables-from-list/m-p/193143#M41322</link>
    <description>&lt;P&gt;thank you!&lt;/P&gt;&lt;P&gt;i actually figured it out.&lt;/P&gt;&lt;P&gt;here is my saloution if anyone would like it.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Clear Globals();
Clear Symbols();
Main Menu("Minimize All");

//Set text export preferences
//Preferences(Export Settings(Export Table Headers));
//Preferences(Export Settings(End of Field(Tab)));

//Initial prompt to select split level
Prompt = New Window ("Output Selection", &amp;lt;&amp;lt;Modal,
	Text Box ("Welcome"),
	Text Box (""),
	Text Box (""),
	V List Box(
	H List Box(
	Panel Box("Pick Join Paramaters           ",
	A  = Radio Box({"Lot, Wafer ID","Lot, date","Entity, Lot"})
	),
	)
	),
	V List Box(Text Box (" 


	"),
	Button Box("OK",
	Join = A &amp;lt;&amp;lt; get;
	))
	);
wait(0);

Path = Pick Directory("Select Analytics Data Directory");
Files_All = Files in Directory(Path);
NFS_All = N Items(Files_All);
Files = {};

//Remove non-text files
For (f=1, f &amp;lt; NFS_All+1, f++,
If(Contains(Files_All[f],".csv") &amp;gt; 0, 
Insert Into(Files,Files_All[f]);
);
);


//Prompt to select individual files
List_NPr = {};
List_Pr = Files;
PromptF = New Window("File Selection", &amp;lt;&amp;lt; Modal,
V List Box(
Text Box ("Select Desired Files"),
Text Box(" "),
H List Box(
V List Box(
Text Box("Files to join:"),
Pr = List Box(List_Pr, width(350), nlines(30)),
Button Box("&amp;gt;&amp;gt;&amp;gt;&amp;gt; Remove Selected &amp;gt;&amp;gt;&amp;gt;&amp;gt;",
List_NPr = concat(List_NPr, Pr &amp;lt;&amp;lt; Get Selected);
List_Pr = remove(List_Pr, Pr &amp;lt;&amp;lt; Get Selected Indices);
Pr &amp;lt;&amp;lt; Set Items(List_Pr); 
NPr &amp;lt;&amp;lt; Set Items(List_NPr); 
)),
Text Box("     "),
V List Box(
Text Box("Files Excluded:"),
NPr = List Box(List_NPr, width(350), nlines(30)),
Button Box("&amp;lt;&amp;lt;&amp;lt;&amp;lt; Add Selected &amp;lt;&amp;lt;&amp;lt;&amp;lt;",
List_Pr = concat(List_Pr, NPr &amp;lt;&amp;lt; Get Selected);
List_NPr = remove(List_NPr, NPr &amp;lt;&amp;lt; Get Selected Indices);
Pr &amp;lt;&amp;lt; Set Items(List_Pr); 
NPr &amp;lt;&amp;lt; Set Items(List_NPr); 
)))));
wait(0);
Files = List_Pr;
NFS = N Items(Files);


// table that others join
Fullpath = Path||Files[1];

DT_old = Open( Fullpath,private);
DT_old &amp;lt;&amp;lt; Minimize Window;

//loop to join other tables
For (a=2, a &amp;lt; NFS+1, a++,

Fullpath = Path||Files[a];

DT_new = Open( Fullpath,private);
DT_new &amp;lt;&amp;lt; Minimize Window;


    join_name = "Limits" || char(a);

    dt_old &amp;lt;&amp;lt; join( with(data table(dt_new)),
        Merge Same Name Columns,
        By Matching Columns(

            :A = :A,

            :B = :B,
            
              :C = :C,

        ),

        Drop multiples( 1, 0 ),

        Name( "Include non-matches" )(1, 1),

        Output Table( join_name )

    );

    close(dt_old, nosave);

   

    dt_old = data table(join_name);

);

&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 16 Apr 2019 13:38:46 GMT</pubDate>
    <dc:creator>walk545</dc:creator>
    <dc:date>2019-04-16T13:38:46Z</dc:date>
    <item>
      <title>join multiple tables from list</title>
      <link>https://community.jmp.com/t5/Discussions/join-multiple-tables-from-list/m-p/193109#M41311</link>
      <description>&lt;P&gt;using the script here i can get a list of tables from any folder. i would like to be able to join tables from the created list. i want the user to be able to choose which tables he/her can join with a preset of which columns to use to join.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Path = Pick Directory("Select Analytics Data Directory");&lt;BR /&gt;Files_All = Files in Directory(Path);&lt;BR /&gt;NFS_All = N Items(Files_All);&lt;BR /&gt;Files = {};&lt;BR /&gt;//Remove non-text files&lt;BR /&gt;For (f=1, f &amp;lt; NFS_All+1, f++,&lt;BR /&gt;If(Contains(Files_All[f],".txt") &amp;gt; 0,&lt;BR /&gt;Insert Into(Files,Files_All[f]);&lt;BR /&gt;);&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;//Prompt to select individual files&lt;BR /&gt;List_NPr = {};&lt;BR /&gt;List_Pr = Files;&lt;BR /&gt;PromptF = New Window("File Selection", &amp;lt;&amp;lt; Modal,&lt;BR /&gt;V List Box(&lt;BR /&gt;Text Box ("Select Desired Files"),&lt;BR /&gt;Text Box(" "),&lt;BR /&gt;H List Box(&lt;BR /&gt;V List Box(&lt;BR /&gt;Text Box("Files to Process:"),&lt;BR /&gt;Pr = List Box(List_Pr, width(350), nlines(30)),&lt;BR /&gt;Button Box("&amp;gt;&amp;gt;&amp;gt;&amp;gt; Remove Selected &amp;gt;&amp;gt;&amp;gt;&amp;gt;",&lt;BR /&gt;List_NPr = concat(List_NPr, Pr &amp;lt;&amp;lt; Get Selected);&lt;BR /&gt;List_Pr = remove(List_Pr, Pr &amp;lt;&amp;lt; Get Selected Indices);&lt;BR /&gt;Pr &amp;lt;&amp;lt; Set Items(List_Pr);&lt;BR /&gt;NPr &amp;lt;&amp;lt; Set Items(List_NPr);&lt;BR /&gt;)),&lt;BR /&gt;Text Box(" "),&lt;BR /&gt;V List Box(&lt;BR /&gt;Text Box("Files Excluded:"),&lt;BR /&gt;NPr = List Box(List_NPr, width(350), nlines(30)),&lt;BR /&gt;Button Box("&amp;lt;&amp;lt;&amp;lt;&amp;lt; Add Selected &amp;lt;&amp;lt;&amp;lt;&amp;lt;",&lt;BR /&gt;List_Pr = concat(List_Pr, NPr &amp;lt;&amp;lt; Get Selected);&lt;BR /&gt;List_NPr = remove(List_NPr, NPr &amp;lt;&amp;lt; Get Selected Indices);&lt;BR /&gt;Pr &amp;lt;&amp;lt; Set Items(List_Pr);&lt;BR /&gt;NPr &amp;lt;&amp;lt; Set Items(List_NPr);&lt;BR /&gt;)))));&lt;BR /&gt;wait(0);&lt;BR /&gt;Files = List_Pr;&lt;BR /&gt;NFS = N Items(Files);&lt;BR /&gt;);&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2019 06:40:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/join-multiple-tables-from-list/m-p/193109#M41311</guid>
      <dc:creator>walk545</dc:creator>
      <dc:date>2019-04-16T06:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: join multiple tables from list</title>
      <link>https://community.jmp.com/t5/Discussions/join-multiple-tables-from-list/m-p/193124#M41315</link>
      <description>&lt;P&gt;So what is your question? You have an extraneous right parentheses in the last line of your script and you are not capturing the final list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is your JSL modified.&amp;nbsp; FList contains the user selected files.&amp;nbsp; &amp;nbsp;The last line shows the final selections.&amp;nbsp; Now you have to script the joins.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Path = Pick Directory( "Select Analytics Data Directory" );
Files_All = Files In Directory( Path );
NFS_All = N Items( Files_All );
Files = {};
//Remove non-text files
For( f = 1, f &amp;lt; NFS_All + 1, f++,
	If( Contains( Files_All[f], ".txt" ) &amp;gt; 0,
		Insert Into( Files, Files_All[f] )
	)
);

//Prompt to select individual files
List_NPr = {};
List_Pr = Files;
PromptF = New Window( "File Selection",
	&amp;lt;&amp;lt;Modal, ,
	V List Box(
		Text Box( "Select Desired Files" ),
		Text Box( " " ),
		H List Box(
			V List Box(
				Text Box( "Files to Process:" ),
				Pr = List Box( List_Pr, width( 350 ), nlines( 30 ) ),
				Button Box( "&amp;gt;&amp;gt;&amp;gt;&amp;gt; Remove Selected &amp;gt;&amp;gt;&amp;gt;&amp;gt;",
					List_NPr = Concat( List_NPr, Pr &amp;lt;&amp;lt; Get Selected );
					List_Pr = Remove( List_Pr, Pr &amp;lt;&amp;lt; Get Selected Indices );
					Pr &amp;lt;&amp;lt; Set Items( List_Pr );
					NPr &amp;lt;&amp;lt; Set Items( List_NPr );
					FList = List_Pr;
				)
			),
			Text Box( " " ),
			V List Box(
				Text Box( "Files Excluded:" ),
				NPr = List Box( List_NPr, width( 350 ), nlines( 30 ) ),
				Button Box( "&amp;lt;&amp;lt;&amp;lt;&amp;lt; Add Selected &amp;lt;&amp;lt;&amp;lt;&amp;lt;",
					List_Pr = Concat( List_Pr, NPr &amp;lt;&amp;lt; Get Selected );
					List_NPr = Remove( List_NPr, NPr &amp;lt;&amp;lt; Get Selected Indices );
					Pr &amp;lt;&amp;lt; Set Items( List_Pr );
					NPr &amp;lt;&amp;lt; Set Items( List_NPr );
					FList = List_Pr;
				)
			)
		)
	)
);
Wait( 0 );
Files = List_Pr;
NFS = N Items( Files );
show(FList);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Apr 2019 09:01:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/join-multiple-tables-from-list/m-p/193124#M41315</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2019-04-16T09:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: join multiple tables from list</title>
      <link>https://community.jmp.com/t5/Discussions/join-multiple-tables-from-list/m-p/193143#M41322</link>
      <description>&lt;P&gt;thank you!&lt;/P&gt;&lt;P&gt;i actually figured it out.&lt;/P&gt;&lt;P&gt;here is my saloution if anyone would like it.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Clear Globals();
Clear Symbols();
Main Menu("Minimize All");

//Set text export preferences
//Preferences(Export Settings(Export Table Headers));
//Preferences(Export Settings(End of Field(Tab)));

//Initial prompt to select split level
Prompt = New Window ("Output Selection", &amp;lt;&amp;lt;Modal,
	Text Box ("Welcome"),
	Text Box (""),
	Text Box (""),
	V List Box(
	H List Box(
	Panel Box("Pick Join Paramaters           ",
	A  = Radio Box({"Lot, Wafer ID","Lot, date","Entity, Lot"})
	),
	)
	),
	V List Box(Text Box (" 


	"),
	Button Box("OK",
	Join = A &amp;lt;&amp;lt; get;
	))
	);
wait(0);

Path = Pick Directory("Select Analytics Data Directory");
Files_All = Files in Directory(Path);
NFS_All = N Items(Files_All);
Files = {};

//Remove non-text files
For (f=1, f &amp;lt; NFS_All+1, f++,
If(Contains(Files_All[f],".csv") &amp;gt; 0, 
Insert Into(Files,Files_All[f]);
);
);


//Prompt to select individual files
List_NPr = {};
List_Pr = Files;
PromptF = New Window("File Selection", &amp;lt;&amp;lt; Modal,
V List Box(
Text Box ("Select Desired Files"),
Text Box(" "),
H List Box(
V List Box(
Text Box("Files to join:"),
Pr = List Box(List_Pr, width(350), nlines(30)),
Button Box("&amp;gt;&amp;gt;&amp;gt;&amp;gt; Remove Selected &amp;gt;&amp;gt;&amp;gt;&amp;gt;",
List_NPr = concat(List_NPr, Pr &amp;lt;&amp;lt; Get Selected);
List_Pr = remove(List_Pr, Pr &amp;lt;&amp;lt; Get Selected Indices);
Pr &amp;lt;&amp;lt; Set Items(List_Pr); 
NPr &amp;lt;&amp;lt; Set Items(List_NPr); 
)),
Text Box("     "),
V List Box(
Text Box("Files Excluded:"),
NPr = List Box(List_NPr, width(350), nlines(30)),
Button Box("&amp;lt;&amp;lt;&amp;lt;&amp;lt; Add Selected &amp;lt;&amp;lt;&amp;lt;&amp;lt;",
List_Pr = concat(List_Pr, NPr &amp;lt;&amp;lt; Get Selected);
List_NPr = remove(List_NPr, NPr &amp;lt;&amp;lt; Get Selected Indices);
Pr &amp;lt;&amp;lt; Set Items(List_Pr); 
NPr &amp;lt;&amp;lt; Set Items(List_NPr); 
)))));
wait(0);
Files = List_Pr;
NFS = N Items(Files);


// table that others join
Fullpath = Path||Files[1];

DT_old = Open( Fullpath,private);
DT_old &amp;lt;&amp;lt; Minimize Window;

//loop to join other tables
For (a=2, a &amp;lt; NFS+1, a++,

Fullpath = Path||Files[a];

DT_new = Open( Fullpath,private);
DT_new &amp;lt;&amp;lt; Minimize Window;


    join_name = "Limits" || char(a);

    dt_old &amp;lt;&amp;lt; join( with(data table(dt_new)),
        Merge Same Name Columns,
        By Matching Columns(

            :A = :A,

            :B = :B,
            
              :C = :C,

        ),

        Drop multiples( 1, 0 ),

        Name( "Include non-matches" )(1, 1),

        Output Table( join_name )

    );

    close(dt_old, nosave);

   

    dt_old = data table(join_name);

);

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Apr 2019 13:38:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/join-multiple-tables-from-list/m-p/193143#M41322</guid>
      <dc:creator>walk545</dc:creator>
      <dc:date>2019-04-16T13:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: join multiple tables from list</title>
      <link>https://community.jmp.com/t5/Discussions/join-multiple-tables-from-list/m-p/193211#M41341</link>
      <description>&lt;P&gt;Please mark your solution as a "Solution".&amp;nbsp; I would also mark Ian's as a solution too.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2019 21:57:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/join-multiple-tables-from-list/m-p/193211#M41341</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-04-16T21:57:42Z</dc:date>
    </item>
  </channel>
</rss>

