<?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: Subsetting a datatable with a For loop and performing colunm operations in each subset in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Subsetting-a-datatable-with-a-For-loop-and-performing-colunm/m-p/187193#M40580</link>
    <description>&lt;P&gt;Hello, thank you for your super fast answer!&lt;/P&gt;&lt;P&gt;i rewrote the script as proposed. The calculation works nicely for the first item of the list than the for loop breaks and never switches to the next item. The debugger mentions something with reference to an object that has no L-value...&lt;/P&gt;&lt;P&gt;Don't really know what it means. Do i need to reset any variable? or delete selection on an active table?&lt;/P&gt;&lt;P&gt;Thanks a lot again!&lt;/P&gt;&lt;P&gt;VG, Mickael&lt;/P&gt;</description>
    <pubDate>Fri, 15 Mar 2019 07:42:50 GMT</pubDate>
    <dc:creator>lmickael</dc:creator>
    <dc:date>2019-03-15T07:42:50Z</dc:date>
    <item>
      <title>Subsetting a datatable with a For loop and performing colunm operations in each subset</title>
      <link>https://community.jmp.com/t5/Discussions/Subsetting-a-datatable-with-a-For-loop-and-performing-colunm/m-p/186958#M40553</link>
      <description>&lt;P&gt;Dear community, i have a hard time on this topic may be someone can help. My Datatable comprises many parts under "Serialnumber" that are measured at different point of time "Timestamp". The results of the Measurement (like Isc, Pmpp, ...)&lt;/P&gt;
&lt;P&gt;ist stored in rows with increasing measurement time. What i need to do ist to normalize the measurement value with the very first measurement (earliest in time) for each part individually. Like Part XY -&amp;gt; (Pmpp/Pmpp0; t=0)&lt;/P&gt;
&lt;P&gt;I wrote a script subsetting my big datatable into many subtables containing only one part and its consecutives measurement over time. As below code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt_LT = Open(big_datatable.jump);
Mod_Tab = dt_LT &amp;lt;&amp;lt; Tabulate( Add Table( Row Table( Grouping Columns( :SerialNumber ) ) ) );
Mod_dt = Mod_Tab &amp;lt;&amp;lt; Make Into Data Table;
Mod_dt &amp;lt;&amp;lt; Set Name( "Modul-Datatable" );
Zahl_Mod = NRow (Mod_dt);
Current Data Table (Mod_dt);
Mod_List = :Name( "SerialNumber") &amp;lt;&amp;lt; Get Values;
content= Text Box(Mod_List);
New Window ("Modul gefunden", content);
Current Data Table (dt_LT);
For (i = 1, i &amp;lt;= Zahl_Mod, i++,
dt_LT &amp;lt;&amp;lt; clear row states;
dt_LT &amp;lt;&amp;lt; select Where (:Name ("SerialNumber") == Mod_List[i]);
If( N Row( dt_LT &amp;lt;&amp;lt; get selected rows ) &amp;lt; 3, Continue() );
Mod = dt_LT &amp;lt;&amp;lt; Subset ((selected Rows), Output Table Name("Module_"||Mod_List[i]));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This works just fine. I get as many subtables as needed. Also find the earliest measurement in each subset works fine. See code below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Current data table(Mod);
Eval (init_Zeit = col minimum(:Timestamp);
init_flash = Mod &amp;lt;&amp;lt; get rows where ((:Timestamp) == init_Zeit);
row = init_flash[1];&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What fails is the normalization. The script get stuck on the last subset and normalizes all other data with the earliest measurement of the last subset table.&amp;nbsp; See the script below&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Em0 = :Eff_Modul[row];
Ez0 = :Eff_Zelle[row];
FF0 = :FF[row];
Impp0 = :Impp[row];
Isc0 = :Isc[row];
Pmpp0 = :Pmpp[row];
Rs_Serial0 = :Rs_Serial[row];
Rsh_Shunt0 = :Rsh_Shunt[row];
Vmpp0 = :Vmpp[row];
Impp0 = :Impp[row];
Voc0 = :Voc[row];
New Column ("Pmpp_Norm", Numeric, continuous,
Formula ( :Pmpp / Pmpp0));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In the last subset table i get a 1 after normalisation in the measurement colunms In all other subtables i get a value that is below 1 for the normalized value. How can i switch between subset tables within the for loop? Can anybody help? Thx in advance&lt;/P&gt;
&lt;P&gt;Mickael&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 13:08:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Subsetting-a-datatable-with-a-For-loop-and-performing-colunm/m-p/186958#M40553</guid>
      <dc:creator>lmickael</dc:creator>
      <dc:date>2019-03-25T13:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting a datatable with a For loop and performing colunm operations in each subset</title>
      <link>https://community.jmp.com/t5/Discussions/Subsetting-a-datatable-with-a-For-loop-and-performing-colunm/m-p/187010#M40557</link>
      <description>&lt;P&gt;You use a global variable &lt;EM&gt;Pmpp0&lt;/EM&gt; in a column formula and when the value of Pmpp0 keeps changing with each iteration the formula calculations change accordingly. If using this approach you must explicitly use the evaluated current value of the variable in the Formula.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Pmpp0 = :Pmpp[row];
F = Eval Expr(:Pmpp / Expr(Pmpp0));// Formula expression with evaluated Pmpp0
Mod &amp;lt;&amp;lt; New Column("Pmpp_Norm", Numeric, continuous, Formula(Name Expr(F)));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2019 16:23:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Subsetting-a-datatable-with-a-For-loop-and-performing-colunm/m-p/187010#M40557</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2019-03-14T16:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting a datatable with a For loop and performing colunm operations in each subset</title>
      <link>https://community.jmp.com/t5/Discussions/Subsetting-a-datatable-with-a-For-loop-and-performing-colunm/m-p/187193#M40580</link>
      <description>&lt;P&gt;Hello, thank you for your super fast answer!&lt;/P&gt;&lt;P&gt;i rewrote the script as proposed. The calculation works nicely for the first item of the list than the for loop breaks and never switches to the next item. The debugger mentions something with reference to an object that has no L-value...&lt;/P&gt;&lt;P&gt;Don't really know what it means. Do i need to reset any variable? or delete selection on an active table?&lt;/P&gt;&lt;P&gt;Thanks a lot again!&lt;/P&gt;&lt;P&gt;VG, Mickael&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2019 07:42:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Subsetting-a-datatable-with-a-For-loop-and-performing-colunm/m-p/187193#M40580</guid>
      <dc:creator>lmickael</dc:creator>
      <dc:date>2019-03-15T07:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting a datatable with a For loop and performing colunm operations in each subset</title>
      <link>https://community.jmp.com/t5/Discussions/Subsetting-a-datatable-with-a-For-loop-and-performing-colunm/m-p/187373#M40620</link>
      <description>&lt;P&gt;The L-value is the left side of an assignment. You are trying to assign something to a non-variable. For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Insert Into( { 5, 6, 7 }, 8 );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This alternative would work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;my list = { 5, 6, 7 };
Insert Into( my list, 8 );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2019 09:54:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Subsetting-a-datatable-with-a-For-loop-and-performing-colunm/m-p/187373#M40620</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-03-18T09:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting a datatable with a For loop and performing colunm operations in each subset</title>
      <link>https://community.jmp.com/t5/Discussions/Subsetting-a-datatable-with-a-For-loop-and-performing-colunm/m-p/189052#M40769</link>
      <description>&lt;P&gt;Thanks for your reply. Actually i had in my for loop an expression that i called "I" this created confusion with the incrementation index "i". I renamed my expression "I1" and it worked!&lt;/P&gt;&lt;P&gt;Thx, Mickael&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 12:22:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Subsetting-a-datatable-with-a-For-loop-and-performing-colunm/m-p/189052#M40769</guid>
      <dc:creator>lmickael</dc:creator>
      <dc:date>2019-03-25T12:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting a datatable with a For loop and performing colunm operations in each subset</title>
      <link>https://community.jmp.com/t5/Discussions/Subsetting-a-datatable-with-a-For-loop-and-performing-colunm/m-p/189053#M40770</link>
      <description>&lt;P&gt;it works nicely. Thx for your help!&lt;/P&gt;&lt;P&gt;Rgds, Mickael&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 12:23:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Subsetting-a-datatable-with-a-For-loop-and-performing-colunm/m-p/189053#M40770</guid>
      <dc:creator>lmickael</dc:creator>
      <dc:date>2019-03-25T12:23:30Z</dc:date>
    </item>
  </channel>
</rss>

