<?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 Assign variable to table based on the contain of the table name. in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Assign-variable-to-table-based-on-the-contain-of-the-table-name/m-p/739656#M92158</link>
    <description>&lt;P&gt;I have multiple table that are open and need to assign variable based on a contain(DC1,DC2,DC3) of the table name. If table name contain DC1 assign dt1, if it Table name contain DC2 assign dt2....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 1: ABC_25C_&lt;STRONG&gt;DC1&lt;/STRONG&gt;_2024&lt;/P&gt;&lt;P&gt;Table 2: ABC_25C_&lt;STRONG&gt;DC2&lt;/STRONG&gt;_2024&lt;/P&gt;&lt;P&gt;Table 3: ABC_25C_&lt;STRONG&gt;DC3&lt;/STRONG&gt;_2024&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the command line that i was try to work with.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;tablelist = Get Data Table List() &amp;lt;&amp;lt; get name;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If(Contains(Concat Items(tablelist), "DC1"),&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dt2= XXXXXXXXX&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;);&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Mar 2024 16:51:13 GMT</pubDate>
    <dc:creator>ConfidenceOwl94</dc:creator>
    <dc:date>2024-03-28T16:51:13Z</dc:date>
    <item>
      <title>Assign variable to table based on the contain of the table name.</title>
      <link>https://community.jmp.com/t5/Discussions/Assign-variable-to-table-based-on-the-contain-of-the-table-name/m-p/739656#M92158</link>
      <description>&lt;P&gt;I have multiple table that are open and need to assign variable based on a contain(DC1,DC2,DC3) of the table name. If table name contain DC1 assign dt1, if it Table name contain DC2 assign dt2....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 1: ABC_25C_&lt;STRONG&gt;DC1&lt;/STRONG&gt;_2024&lt;/P&gt;&lt;P&gt;Table 2: ABC_25C_&lt;STRONG&gt;DC2&lt;/STRONG&gt;_2024&lt;/P&gt;&lt;P&gt;Table 3: ABC_25C_&lt;STRONG&gt;DC3&lt;/STRONG&gt;_2024&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the command line that i was try to work with.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;tablelist = Get Data Table List() &amp;lt;&amp;lt; get name;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If(Contains(Concat Items(tablelist), "DC1"),&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dt2= XXXXXXXXX&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;);&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 16:51:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Assign-variable-to-table-based-on-the-contain-of-the-table-name/m-p/739656#M92158</guid>
      <dc:creator>ConfidenceOwl94</dc:creator>
      <dc:date>2024-03-28T16:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Assign variable to table based on the contain of the table name.</title>
      <link>https://community.jmp.com/t5/Discussions/Assign-variable-to-table-based-on-the-contain-of-the-table-name/m-p/739671#M92160</link>
      <description>&lt;P&gt;How do you open those tables? Could you create references during that process? I would also store those into a list instead of trying to use separate dt1, dt2, dt3... for them.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 17:00:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Assign-variable-to-table-based-on-the-contain-of-the-table-name/m-p/739671#M92160</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-03-28T17:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Assign variable to table based on the contain of the table name.</title>
      <link>https://community.jmp.com/t5/Discussions/Assign-variable-to-table-based-on-the-contain-of-the-table-name/m-p/739680#M92161</link>
      <description>&lt;P&gt;They are created by some other automated JMP script that I don't have access to.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 17:01:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Assign-variable-to-table-based-on-the-contain-of-the-table-name/m-p/739680#M92161</guid>
      <dc:creator>ConfidenceOwl94</dc:creator>
      <dc:date>2024-03-28T17:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Assign variable to table based on the contain of the table name.</title>
      <link>https://community.jmp.com/t5/Discussions/Assign-variable-to-table-based-on-the-contain-of-the-table-name/m-p/739685#M92162</link>
      <description>&lt;P&gt;If you can be 100% sure about the names, then I would store them into a list&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

New Table("ABC_25C_DC1_2024");
New Table("ABC_25C_DC2_2024");
New Table("ABC_25C_DC3_2024");


tablelist = Get Data Table List() &amp;lt;&amp;lt; get name;

dc_tables = {};

For Each({tablename}, tablelist,
	If(Starts With(tablename, "ABC_25C_DC"), // some pattern to catch correct tables
		Insert Into(dc_tables, Datatable(tablename));
	);
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can then access them with dc_tables[1] and so on.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 17:12:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Assign-variable-to-table-based-on-the-contain-of-the-table-name/m-p/739685#M92162</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-03-28T17:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: Assign variable to table based on the contain of the table name.</title>
      <link>https://community.jmp.com/t5/Discussions/Assign-variable-to-table-based-on-the-contain-of-the-table-name/m-p/739799#M92180</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this will clarify further of what I am trying to achieve.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ConfidenceOwl94_1-1711648238903.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/62829i1E385B94636FED01/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ConfidenceOwl94_1-1711648238903.png" alt="ConfidenceOwl94_1-1711648238903.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 17:50:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Assign-variable-to-table-based-on-the-contain-of-the-table-name/m-p/739799#M92180</guid>
      <dc:creator>ConfidenceOwl94</dc:creator>
      <dc:date>2024-03-28T17:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: Assign variable to table based on the contain of the table name.</title>
      <link>https://community.jmp.com/t5/Discussions/Assign-variable-to-table-based-on-the-contain-of-the-table-name/m-p/739849#M92185</link>
      <description>&lt;P&gt;I don't think that provides any additional clarification to me, expect that you can capture the table "type" after last _. If you can capture table "type" from the end (after last _) you can use Associative Array (or still a list). You can use Word to capture the last part of name&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

str = "ABC_25C_DC1_2024";

last_part = Word(-1, str, "_");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Final idea would still be the same, find some way of getting references to your tables, store them into some data structure (list or associative array), get the tables from that data structure when needed using index (list) or key (associative array).&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 17:58:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Assign-variable-to-table-based-on-the-contain-of-the-table-name/m-p/739849#M92185</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-03-28T17:58:15Z</dc:date>
    </item>
  </channel>
</rss>

