<?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: Several Data Tables created in a same script in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Several-Data-Tables-created-in-a-same-script/m-p/34704#M20490</link>
    <description>&lt;P&gt;Since you are working with matricies, I will then ask the question, why are you putting the data into a data table, and then treating the data table like it is a matrix holder?&amp;nbsp; All of the steps you are doing in your script could easily and more quickly done in open JSL using matricies.&lt;/P&gt;</description>
    <pubDate>Wed, 18 Jan 2017 19:11:41 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2017-01-18T19:11:41Z</dc:date>
    <item>
      <title>Several Data Tables created in a same script</title>
      <link>https://community.jmp.com/t5/Discussions/Several-Data-Tables-created-in-a-same-script/m-p/34678#M20479</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a second Data Table from a created first Data Table in a same script, is it possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;BR /&gt;dt_= Open(path_pst);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//First Data Table&lt;/P&gt;&lt;P&gt;start = New Table("W",&lt;BR /&gt;New Column("S"),&lt;BR /&gt;New Column("Z"),&lt;BR /&gt;New Column("X"),&lt;BR /&gt;New Column("Y"),&lt;BR /&gt;New Column("E"),&lt;BR /&gt;New Column("W"),&lt;BR /&gt;New Column("S"),&lt;BR /&gt;Add Rows(545)&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Some Calculations&lt;/P&gt;&lt;P&gt;for(i=1,i&amp;lt;=545,i++,&lt;BR /&gt;W:B[i] = ((dt_ - dt_*60)/8;&lt;BR /&gt;W:S[i] = dt_[i];&lt;BR /&gt;W:X[i] = dt_[i]/10000000;&lt;BR /&gt;W:Y[i] = dt_[i]/10000000;&lt;BR /&gt;W:E[i] = dt_[i];&lt;BR /&gt;W:W[i] = dt_[i];&lt;BR /&gt;W:S[i] = dt_[i];&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Creating a second&amp;nbsp;Data Table&lt;/P&gt;&lt;P&gt;start = New Table("WIWM",&lt;BR /&gt;New Column("Si"),&lt;BR /&gt;New Column("Ba"),&lt;BR /&gt;New Column("X1"),&lt;BR /&gt;New Column("Y1"),&lt;BR /&gt;New Column("En"),&lt;BR /&gt;New Column("Wa"),&lt;BR /&gt;New Column("M"),&lt;BR /&gt;Add Rows(109)&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Calculation for second Data Tabe based on the first Data Table created&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for (i=1, i&amp;lt;=109,i++,&lt;BR /&gt;WIWM:Ba[i] = (W:B[i+109]+W:B[i+218]+W:B[i+327]+W:B[i+436])/4;&lt;BR /&gt;WIWM:Si[i] = W:S[i];&lt;BR /&gt;WIWM:X1[i] = W:X[i];&lt;BR /&gt;WIWM:Y1[i] = W:Y[i];&lt;BR /&gt;WIWM:En[i] = W:E[i];&lt;BR /&gt;WIWM:Wa[i] = W:W[i];&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After First Data Table comes as expected, second Data Table comes with expected rows numbers but blanked( for condition not run).&lt;/P&gt;&lt;P&gt;If I will saparate Script so in a first part I will perform the first calculation and save it and after I will run a second part on saved Data Table I will get my calculation done for second Data Table.&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;</description>
      <pubDate>Wed, 18 Jan 2017 05:14:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Several-Data-Tables-created-in-a-same-script/m-p/34678#M20479</guid>
      <dc:creator>RosDima</dc:creator>
      <dc:date>2017-01-18T05:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Several Data Tables created in a same script</title>
      <link>https://community.jmp.com/t5/Discussions/Several-Data-Tables-created-in-a-same-script/m-p/34680#M20480</link>
      <description>&lt;P&gt;use the data table &lt;EM&gt;object&lt;/EM&gt; returned by the NewTable &lt;EM&gt;function&lt;/EM&gt; to tell which table a variable is in. The table's &lt;EM&gt;name&lt;/EM&gt; is not used for the scoping of the variables. The third assignment uses all three tables. I named everything uniquely, but that isn't required with scoping. &amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;dt3:&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;, for example, sets the &lt;EM&gt;scope&lt;/EM&gt;, or the places to look, for the variable that follows, z, in this example.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt1 = New Table( "table name A", New Column( "x", values( [1 2 3] ) ) );
dt2 = New Table( "table name Squares", New Column( "y" ), addrows( 3 ) );
dt3 = New Table( "table name Cubes", New Column( "z" ), addrows( 3 ) );

For( i = 1, i &amp;lt;= N Rows( dt1 ), i++,
    dt2:y[i] = dt1:x[i] ^ 2;
    dt3:z[i] = dt1:x[i] * dt2:y[i];
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="small table of Cubes" style="width: 727px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/4844i9FCD16B4E647EAF4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Cubes.PNG" alt="small table of Cubes" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;small table of Cubes&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 12:41:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Several-Data-Tables-created-in-a-same-script/m-p/34680#M20480</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-01-18T12:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Several Data Tables created in a same script</title>
      <link>https://community.jmp.com/t5/Discussions/Several-Data-Tables-created-in-a-same-script/m-p/34681#M20481</link>
      <description>&lt;P&gt;Your script taught me something new.&amp;nbsp; I could not find any documentation of it, but your script shows that it works.....kind of.&lt;/P&gt;
&lt;P&gt;In your code, you are referencing rows and columns in the data tables by&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data table name : column name[ row ]&lt;/P&gt;
&lt;P&gt;So when you specify&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start = New Table( "W", New Column( "S"), ..........&lt;/P&gt;
&lt;P&gt;You reference the column "S" in row "5" as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; W:S[5]&lt;/P&gt;
&lt;P&gt;and apparently that works.&amp;nbsp; However, later in your script, you attempt to use the same logic for the data table you name&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start = New Table( "WIWM", New Column( "Si").........&lt;/P&gt;
&lt;P&gt;and you try to reference back to your data table named W&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WIWM:SI[1] = W:S[1];&lt;/P&gt;
&lt;P&gt;and that doesn't work.&lt;/P&gt;
&lt;P&gt;The issue is, that the proper way to setup a data table namespace reference is to assign the namespace name by the use of an assignment statement, not the data table name.&amp;nbsp; My new learning is that apparently JMP will use the data table name as a name space until a new data table is created, and then it looses the data table name namespace link.&lt;/P&gt;
&lt;P&gt;The bottom line is that your code will work fine if you change the line&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start = New Table("W",&lt;/P&gt;
&lt;P&gt;to&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; W = New Table("W",&lt;/P&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start = New Table("WIWM",&lt;/P&gt;
&lt;P&gt;to&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WIWM = New Table("WIWM",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, you open a file of some sort and reference it as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt_ = open(path_pst);&lt;/P&gt;
&lt;P&gt;What is it you are opening?&amp;nbsp; I assume it is a matrix.&amp;nbsp; Could you please get back to me on this, so I can have a better understanding on what is really going on in your code.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 12:54:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Several-Data-Tables-created-in-a-same-script/m-p/34681#M20481</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-01-18T12:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Several Data Tables created in a same script</title>
      <link>https://community.jmp.com/t5/Discussions/Several-Data-Tables-created-in-a-same-script/m-p/34696#M20485</link>
      <description>&lt;P&gt;Thanks Jim. &amp;nbsp;I'm adding this to the list of things to investigate further...like you, I had no idea there was something like that.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 16:22:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Several-Data-Tables-created-in-a-same-script/m-p/34696#M20485</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-01-18T16:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Several Data Tables created in a same script</title>
      <link>https://community.jmp.com/t5/Discussions/Several-Data-Tables-created-in-a-same-script/m-p/34697#M20486</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for a quick replay.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, I am working with matrix, first one is n columns, and 545 rows&amp;nbsp;(I can use col&amp;nbsp;number function but it was for you to see the number)&lt;/P&gt;&lt;P&gt;From firts actual Data Table, I need filter and create a new Data Table - "first one" with 545 rows and matrix as well.&lt;/P&gt;&lt;P&gt;After that, I need to perform another calculations from "first one" and eventually get "second one" with 109 rows and also martix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 16:50:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Several-Data-Tables-created-in-a-same-script/m-p/34697#M20486</guid>
      <dc:creator>RosDima</dc:creator>
      <dc:date>2017-01-18T16:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: Several Data Tables created in a same script</title>
      <link>https://community.jmp.com/t5/Discussions/Several-Data-Tables-created-in-a-same-script/m-p/34704#M20490</link>
      <description>&lt;P&gt;Since you are working with matricies, I will then ask the question, why are you putting the data into a data table, and then treating the data table like it is a matrix holder?&amp;nbsp; All of the steps you are doing in your script could easily and more quickly done in open JSL using matricies.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 19:11:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Several-Data-Tables-created-in-a-same-script/m-p/34704#M20490</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-01-18T19:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: Several Data Tables created in a same script</title>
      <link>https://community.jmp.com/t5/Discussions/Several-Data-Tables-created-in-a-same-script/m-p/34709#M20495</link>
      <description>&lt;P&gt;Can you give me an example?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 22:54:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Several-Data-Tables-created-in-a-same-script/m-p/34709#M20495</guid>
      <dc:creator>RosDima</dc:creator>
      <dc:date>2017-01-18T22:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Several Data Tables created in a same script</title>
      <link>https://community.jmp.com/t5/Discussions/Several-Data-Tables-created-in-a-same-script/m-p/34713#M20499</link>
      <description>&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Uncharted/What-is-the-JSL-Matrix/ba-p/33349" target="_blank"&gt;https://community.jmp.com/t5/Uncharted/What-is-the-JSL-Matrix/ba-p/33349&lt;/A&gt; is a brief introduction. There is doc too:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.jmp.com/support/help/Matrices.shtml" target="_blank"&gt;http://www.jmp.com/support/help/Matrices.shtml&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.jmp.com/support/help/Matrix_Functions.shtml" target="_blank"&gt;http://www.jmp.com/support/help/Matrix_Functions.shtml&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2017 01:33:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Several-Data-Tables-created-in-a-same-script/m-p/34713#M20499</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-01-19T01:33:53Z</dc:date>
    </item>
  </channel>
</rss>

