<?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: Help with formula: Calculating change relative to an initial timepoints for multiple samples in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Help-with-formula-Calculating-change-relative-to-an-initial/m-p/640355#M83770</link>
    <description>&lt;P&gt;Jim,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the response.&amp;nbsp; I've tried the above and get the following error message:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ClusterFerret68_0-1686230288412.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/53547i3586FBF346A889F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ClusterFerret68_0-1686230288412.png" alt="ClusterFerret68_0-1686230288412.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Note: I had pasted in your script to a "New Script" and run it.&amp;nbsp; I also tried using the script in the formula editor...in that case there was an error stating that the Current Data Table function has side effects or is inappropriate to use in a formula.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I might be missing something simple...any thoughts?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jun 2023 13:21:20 GMT</pubDate>
    <dc:creator>ClusterFerret68</dc:creator>
    <dc:date>2023-06-08T13:21:20Z</dc:date>
    <item>
      <title>Help with formula: Calculating change relative to an initial timepoints for multiple samples</title>
      <link>https://community.jmp.com/t5/Discussions/Help-with-formula-Calculating-change-relative-to-an-initial/m-p/640239#M83755</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am somewhat new to making conditional formulas in JMP and am having some difficulty with this one.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will be collecting data at specific timepoints for multiple different samples.&amp;nbsp; Each sample has a corresponding value for the initial (T=0) timepoint and I would like to have a column for the %difference at a given timepoint relative to T=0.&amp;nbsp; The table will include multiple replicates of each sample (arranged in rows) and a dozen or so metrics (in columns).&amp;nbsp; Here's the general idea of the table format:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ClusterFerret68_0-1686188865744.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/53537iB6650B2314157FE4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ClusterFerret68_0-1686188865744.png" alt="ClusterFerret68_0-1686188865744.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've tried to set the math to Match based on the Sample Designation column but am having difficulty with the conditional syntax for pointing a given row to its respective T=0 datum.&amp;nbsp; I found the following searching for similar issues but was unable to modify the script to match my layout:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Discussions/Divide-column-by-reference-point-with-conditions/m-p/432899#M68261" target="_blank"&gt;https://community.jmp.com/t5/Discussions/Divide-column-by-reference-point-with-conditions/m-p/432899#M68261&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Granted: I am less-than-a-novice with scripts...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've included the jmp table as well.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks in advance for your help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 00:02:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-with-formula-Calculating-change-relative-to-an-initial/m-p/640239#M83755</guid>
      <dc:creator>ClusterFerret68</dc:creator>
      <dc:date>2023-06-11T00:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help with formula: Calculating change relative to an initial timepoints for multiple samples</title>
      <link>https://community.jmp.com/t5/Discussions/Help-with-formula-Calculating-change-relative-to-an-initial/m-p/640262#M83756</link>
      <description>&lt;P&gt;Note in Review!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The image in the thread doesn't accurately represent the replicate measurements...sorry.&amp;nbsp; The jmp table is correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This image is correct also:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ClusterFerret68_0-1686189599595.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/53539iA38965B75EDF7222/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ClusterFerret68_0-1686189599595.png" alt="ClusterFerret68_0-1686189599595.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 02:00:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-with-formula-Calculating-change-relative-to-an-initial/m-p/640262#M83756</guid>
      <dc:creator>ClusterFerret68</dc:creator>
      <dc:date>2023-06-08T02:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help with formula: Calculating change relative to an initial timepoints for multiple samples</title>
      <link>https://community.jmp.com/t5/Discussions/Help-with-formula-Calculating-change-relative-to-an-initial/m-p/640271#M83757</link>
      <description>&lt;P&gt;Here is the formula that I used.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;currentSample = :Sample Designation;
timePointZero = :Data[(Current Data Table() &amp;lt;&amp;lt; get rows where( :"Time Point (h)"n == 0 &amp;amp; :Sample Designation == currentSample ))[1]];
Abs( (timePointZero - :Data) / timePointZero );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1686199119993.png" style="width: 809px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/53540i9E96532788D3BBDD/image-dimensions/809x601?v=v2" width="809" height="601" role="button" title="txnelson_0-1686199119993.png" alt="txnelson_0-1686199119993.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 04:39:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-with-formula-Calculating-change-relative-to-an-initial/m-p/640271#M83757</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-06-08T04:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help with formula: Calculating change relative to an initial timepoints for multiple samples</title>
      <link>https://community.jmp.com/t5/Discussions/Help-with-formula-Calculating-change-relative-to-an-initial/m-p/640333#M83763</link>
      <description>&lt;P&gt;I like using Col-functions to get the needed row number. In this case it seems like the Time Point = 0 is always before the later time points, so simple Col Min should be enough&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;:Data/:Data[Col Min(Row(), :Sample Designation)] - 1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This part&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Min(Row(), :Sample Designation)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is used to get the smallest row number of each Sample Designation and because data is sorted it will get Time Point = 0.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 10:35:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-with-formula-Calculating-change-relative-to-an-initial/m-p/640333#M83763</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-06-08T10:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Help with formula: Calculating change relative to an initial timepoints for multiple samples</title>
      <link>https://community.jmp.com/t5/Discussions/Help-with-formula-Calculating-change-relative-to-an-initial/m-p/640355#M83770</link>
      <description>&lt;P&gt;Jim,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the response.&amp;nbsp; I've tried the above and get the following error message:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ClusterFerret68_0-1686230288412.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/53547i3586FBF346A889F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ClusterFerret68_0-1686230288412.png" alt="ClusterFerret68_0-1686230288412.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Note: I had pasted in your script to a "New Script" and run it.&amp;nbsp; I also tried using the script in the formula editor...in that case there was an error stating that the Current Data Table function has side effects or is inappropriate to use in a formula.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I might be missing something simple...any thoughts?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 13:21:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-with-formula-Calculating-change-relative-to-an-initial/m-p/640355#M83770</guid>
      <dc:creator>ClusterFerret68</dc:creator>
      <dc:date>2023-06-08T13:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help with formula: Calculating change relative to an initial timepoints for multiple samples</title>
      <link>https://community.jmp.com/t5/Discussions/Help-with-formula-Calculating-change-relative-to-an-initial/m-p/640358#M83772</link>
      <description>&lt;P&gt;Hi Jarmo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works perfectly...thanks!&amp;nbsp; I am not perfectly clear what is happening with this script.&amp;nbsp; Can you please re-explain?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 13:27:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-with-formula-Calculating-change-relative-to-an-initial/m-p/640358#M83772</guid>
      <dc:creator>ClusterFerret68</dc:creator>
      <dc:date>2023-06-08T13:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help with formula: Calculating change relative to an initial timepoints for multiple samples</title>
      <link>https://community.jmp.com/t5/Discussions/Help-with-formula-Calculating-change-relative-to-an-initial/m-p/640414#M83775</link>
      <description>&lt;P&gt;I reapplied the formula I provided to the example data table that you provided and found not error.&amp;nbsp; I have attached the formula to your sample table and attached it to this response.&amp;nbsp; Please verify that it runs correctly in your system.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 16:59:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-with-formula-Calculating-change-relative-to-an-initial/m-p/640414#M83775</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-06-08T16:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help with formula: Calculating change relative to an initial timepoints for multiple samples</title>
      <link>https://community.jmp.com/t5/Discussions/Help-with-formula-Calculating-change-relative-to-an-initial/m-p/640444#M83779</link>
      <description>&lt;P&gt;Hi Jim,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I open the data table I see the correct values in the last column.&amp;nbsp; However, there is no formula in the column info (and the column isn't indicated as a formula column).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 16:48:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-with-formula-Calculating-change-relative-to-an-initial/m-p/640444#M83779</guid>
      <dc:creator>ClusterFerret68</dc:creator>
      <dc:date>2023-06-08T16:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help with formula: Calculating change relative to an initial timepoints for multiple samples</title>
      <link>https://community.jmp.com/t5/Discussions/Help-with-formula-Calculating-change-relative-to-an-initial/m-p/640512#M83788</link>
      <description>&lt;P&gt;My error.....here is a corrected table with formula.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 20:50:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-with-formula-Calculating-change-relative-to-an-initial/m-p/640512#M83788</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-06-08T20:50:39Z</dc:date>
    </item>
  </channel>
</rss>

