<?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: Select only tables which contain a specific string in the table to use as variable in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Select-only-tables-which-contain-a-specific-string-in-the-table/m-p/267829#M52141</link>
    <description>&lt;P&gt;I apologize, I thought your issue was in building the dtLIst.&amp;nbsp; The issue is slightly different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The issue lies in providing to the Concatenate Platform the proper information.&amp;nbsp; The structure of the Concatenate Platform's required input is&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Data Table() &amp;lt;&amp;lt; concatenate( data table(), data table()…., Append to first table(1) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What you are passing to Concatenate is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Data Table( "LogP" ) &amp;lt;&amp;lt; Concatenate( Data Table( {"Pvalues PBS vs PBS", "Pvalues PBS vs 741039", "Pvalues PBS vs 740410", "Pvalues PBS vs 709966", "Pvalues PBS vs 709878", "Pvalues PBS vs 709573", "Pvalues PBS vs 709547", "Pvalues PBS vs 709544"} ), "Append to first table" )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The primary issue is that each of the data table names you have, need to be changed to the format of Data Table( "...….." )&lt;/P&gt;
&lt;P&gt;This can be done with two small changes.&lt;/P&gt;
&lt;P&gt;First, change the structure of your dtLIst.&amp;nbsp; You don't want just the data table name, but the whole structure&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For( i = 1, i &amp;lt;= N Table(), i++,
	dt = data table(i);
	if(contains(uppercase(dt),uppercase(c)),
	insert into(dtLIst, dt ))
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Next, the Concatenate statement becomes&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;data table("LogP")&amp;lt;&amp;lt;concatenate( dtLIst,  Append To First Table(1));&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 19 May 2020 19:38:06 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2020-05-19T19:38:06Z</dc:date>
    <item>
      <title>Select only tables which contain a specific string in the table to use as variable</title>
      <link>https://community.jmp.com/t5/Discussions/Select-only-tables-which-contain-a-specific-string-in-the-table/m-p/267804#M52135</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying to concatenate a bunch of tables that are generated iteratively by a process.&lt;/P&gt;&lt;P&gt;The name of&amp;nbsp; those tables all start with the same prefix.&lt;/P&gt;&lt;P&gt;I can easily concatenate all the open tables but I'm unable to find the correct syntax to only concatenate those tables with a specific prefix and leave the other ones alone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sebastien&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//The first script to concatenate only tables with 'Pvalue' in the name  fails
//But the dtLIst does shows the correct list of tables BUT list them without the 'data table' prefix.
// as a result, the concatenation step does not interpret them as a list of table
clear log();
Names Default To Here( 1 );
try(data table("LogP")&amp;lt;&amp;lt;close window,"");
dx=new table("LogP");
c = "Pvalues ";
dtLIst = {};

For( i = 1, i &amp;lt;= N Table(), i++,
	dt = data table(i)&amp;lt;&amp;lt;get name;
	if(contains(eval(dt),c),
	insert into(dtLIst, dt ))
);

print(dtLIst);
data table("LogP")&amp;lt;&amp;lt;concatenate(data table (dtLIst}),"Append To First Table");

//This scripts to concatante all the table works
//Shows the list of table with the 'data table' prefix
Names Default To Here( 1 );
try(data table("LogX")&amp;lt;&amp;lt;close window,"");
dx=new table("LogX");
dxLIst = {};

For( i = 1, i &amp;lt;= N Table(), i++,
	dt = data table(i);
	insert into(dxList, dt );
);

print(dxLIst);
data table("LogX")&amp;lt;&amp;lt;concatenate(eval(dxLIst),"Append To First Table")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2020 18:28:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Select-only-tables-which-contain-a-specific-string-in-the-table/m-p/267804#M52135</guid>
      <dc:creator>Sburel</dc:creator>
      <dc:date>2020-05-19T18:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: Select only tables which contain a specific string in the table to use as variable</title>
      <link>https://community.jmp.com/t5/Discussions/Select-only-tables-which-contain-a-specific-string-in-the-table/m-p/267810#M52137</link>
      <description>&lt;P&gt;I can not see anything inherently wrong.....but you could be having a upper/lower case issue&amp;nbsp; try&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(contains(uppercase(dt), uppercase(c),
insert into(dtLIst, dt )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 May 2020 18:47:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Select-only-tables-which-contain-a-specific-string-in-the-table/m-p/267810#M52137</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-05-19T18:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: Select only tables which contain a specific string in the table to use as variable</title>
      <link>https://community.jmp.com/t5/Discussions/Select-only-tables-which-contain-a-specific-string-in-the-table/m-p/267821#M52139</link>
      <description>&lt;P&gt;Hi Jim,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the quick reply. I've tried you fix to no avail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the Log I get when I implement my script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dtLIst =&amp;gt;&lt;/P&gt;&lt;P&gt;"{"Pvalues PBS vs PBS", "Pvalues PBS vs 741039", "Pvalues PBS vs 740410", "Pvalues PBS vs 709966", "Pvalues PBS vs 709878", "Pvalues PBS vs 709573", "Pvalues PBS vs 709547", "Pvalues PBS vs 709544"}&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Cannot locate data table in access or evaluation of 'Data Table' , Data Table/*###*/(dtLIst)&lt;/P&gt;&lt;P&gt;at line 19 in C:\Users\sburel\Ionis\Neurology Research - Documents\Core\Neurotoxicology\Miscellaneous Research Activities\DATABASE ALL CNS DATA\Associated scripts\intermediate and toy scripts\Toy example to concatenate multiple tables with a specific string in nam.jsl "&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I use the next part of the script, here's the Log I get for dxLIst=&amp;gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"{DataTable("LogX"), DataTable("LogP"), DataTable("Pvalues PBS vs PBS"), DataTable("Pvalues PBS vs 741039"), DataTable("Pvalues PBS vs 740410"), DataTable("Pvalues PBS vs 709966"), DataTable("Pvalues PBS vs 709878"), DataTable("Pvalues PBS vs 709573"), DataTable("Pvalues PBS vs 709547"), DataTable("Pvalues PBS vs 709544"), DataTable("NT191209 7-DGE in vivo mouse single stacked")}"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second list gets concatenated just fine but included tables I don't want. The first list (dtLIst) does not contain&amp;nbsp; the&amp;nbsp; "Data table ("xyz").&lt;/P&gt;&lt;P&gt;I suspect that I'm not using the proper syntax to tell the script to evaluate each items in the first list as a data table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//This script to concatenate only table with 'Pvalue' in the name  fails
//But the dtLIst does shows the correct list of tables BUT list them without the 'data table' prefix.
// as a result, the concatenation step does not interpret them as a list of table
clear log();
Names Default To Here( 1 );
try(data table("LogP")&amp;lt;&amp;lt;close window,"");
dx=new table("LogP");
c = "Pvalues ";
dtLIst = {};

For( i = 1, i &amp;lt;= N Table(), i++,
	dt = data table(i)&amp;lt;&amp;lt;get name;
	if(contains(uppercase(dt),uppercase(c)),
	insert into(dtLIst, dt ))
);

print(dtLIst);
data table("LogP")&amp;lt;&amp;lt;concatenate(data table (dtLIst),"Append To First Table");

//This scripts to concatenate all the tables works
//Shows the list of table with the 'data table' prefix
Names Default To Here( 1 );
try(data table("LogX")&amp;lt;&amp;lt;close window,"");
dx=new table("LogX");
dxLIst = {};

For( i = 1, i &amp;lt;= N Table(), i++,
	dt = data table(i);
	insert into(dxList, dt );
);

print(dxLIst);
data table("LogX")&amp;lt;&amp;lt;concatenate(eval(dxLIst),"Append To First Table")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Maybe you'll be able to see the errors of my way :)&lt;/img&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sebastien&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2020 19:04:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Select-only-tables-which-contain-a-specific-string-in-the-table/m-p/267821#M52139</guid>
      <dc:creator>Sburel</dc:creator>
      <dc:date>2020-05-19T19:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Select only tables which contain a specific string in the table to use as variable</title>
      <link>https://community.jmp.com/t5/Discussions/Select-only-tables-which-contain-a-specific-string-in-the-table/m-p/267829#M52141</link>
      <description>&lt;P&gt;I apologize, I thought your issue was in building the dtLIst.&amp;nbsp; The issue is slightly different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The issue lies in providing to the Concatenate Platform the proper information.&amp;nbsp; The structure of the Concatenate Platform's required input is&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Data Table() &amp;lt;&amp;lt; concatenate( data table(), data table()…., Append to first table(1) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What you are passing to Concatenate is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Data Table( "LogP" ) &amp;lt;&amp;lt; Concatenate( Data Table( {"Pvalues PBS vs PBS", "Pvalues PBS vs 741039", "Pvalues PBS vs 740410", "Pvalues PBS vs 709966", "Pvalues PBS vs 709878", "Pvalues PBS vs 709573", "Pvalues PBS vs 709547", "Pvalues PBS vs 709544"} ), "Append to first table" )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The primary issue is that each of the data table names you have, need to be changed to the format of Data Table( "...….." )&lt;/P&gt;
&lt;P&gt;This can be done with two small changes.&lt;/P&gt;
&lt;P&gt;First, change the structure of your dtLIst.&amp;nbsp; You don't want just the data table name, but the whole structure&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For( i = 1, i &amp;lt;= N Table(), i++,
	dt = data table(i);
	if(contains(uppercase(dt),uppercase(c)),
	insert into(dtLIst, dt ))
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Next, the Concatenate statement becomes&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;data table("LogP")&amp;lt;&amp;lt;concatenate( dtLIst,  Append To First Table(1));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 May 2020 19:38:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Select-only-tables-which-contain-a-specific-string-in-the-table/m-p/267829#M52141</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-05-19T19:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: Select only tables which contain a specific string in the table to use as variable</title>
      <link>https://community.jmp.com/t5/Discussions/Select-only-tables-which-contain-a-specific-string-in-the-table/m-p/267837#M52142</link>
      <description>&lt;P&gt;No need to apologize! I was probably not very clear in the first place.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, we must be close but the construction of the dtLIst is not working. I tried with with and without uppercase to no avail&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the log from the run:&amp;nbsp;&lt;/P&gt;&lt;P&gt;argument should be character in access or evaluation of 'Uppercase' , Bad Argument( dt ), Uppercase/*###*/(dt)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So close, yet so far...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my current code&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;clear log();
Names Default To Here( 1 );
try(data table("LogP")&amp;lt;&amp;lt;close window,"");
dx=new table("LogP");
c = "Pvalues ";
dtLIst = {};

For( i = 1, i &amp;lt;= N Table(), i++,
	dt = data table(i);
	if(contains(uppercase(dt),uppercase(c)),
	insert into(dtLIst, dt ))
);

print(dtLIst);
data table("LogP")&amp;lt;&amp;lt;concatenate(dtLIst, Append To First Table (1));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2020 20:35:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Select-only-tables-which-contain-a-specific-string-in-the-table/m-p/267837#M52142</guid>
      <dc:creator>Sburel</dc:creator>
      <dc:date>2020-05-19T20:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Select only tables which contain a specific string in the table to use as variable</title>
      <link>https://community.jmp.com/t5/Discussions/Select-only-tables-which-contain-a-specific-string-in-the-table/m-p/267842#M52143</link>
      <description>&lt;P&gt;The structure of what dt is has changed, so the contains needs to be changed to&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;contains(uppercase(dt&amp;lt;&amp;lt;get name),uppercase(c))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 May 2020 20:52:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Select-only-tables-which-contain-a-specific-string-in-the-table/m-p/267842#M52143</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-05-19T20:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Select only tables which contain a specific string in the table to use as variable</title>
      <link>https://community.jmp.com/t5/Discussions/Select-only-tables-which-contain-a-specific-string-in-the-table/m-p/267850#M52147</link>
      <description>That did the trick!&lt;BR /&gt;&lt;BR /&gt;Thank you so much.&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;&lt;BR /&gt;Sebastien</description>
      <pubDate>Tue, 19 May 2020 21:20:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Select-only-tables-which-contain-a-specific-string-in-the-table/m-p/267850#M52147</guid>
      <dc:creator>Sburel</dc:creator>
      <dc:date>2020-05-19T21:20:04Z</dc:date>
    </item>
  </channel>
</rss>

