<?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: Use list of values in formula in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Use-list-of-values-in-formula/m-p/236518#M46675</link>
    <description>&lt;P&gt;I think adding the formula below to a column in your TSE data test datatable will get you what you want&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Mean( If( :Name( "Time since dosing-[hours]" ) == 0.5, :Name( "DistK-[cm]" ) ), :Animal No. )&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 26 Nov 2019 14:28:02 GMT</pubDate>
    <dc:creator>wgardnerQS</dc:creator>
    <dc:date>2019-11-26T14:28:02Z</dc:date>
    <item>
      <title>Use list of values in formula</title>
      <link>https://community.jmp.com/t5/Discussions/Use-list-of-values-in-formula/m-p/236487#M46669</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I´m trying to calculate the distance that animals have travelled at a given time point adjusted for baseline.&lt;/P&gt;
&lt;P&gt;I have identified the total distance for each animal (&amp;amp;AM distance) and now need to subtract the baseline distance. This baseline is defined by 30 min after dosing. As the distance in the dataset is accumulated values I need to find the one value that matches the baseline timepoint. I have done this as shown below (which works and results in a list of baseline values):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Dist_baseline = :Name( "DistK-[cm]" )[Data Table( "TSE data" ) &amp;lt;&amp;lt; Get rows Where(
	:("Time since dosing-[hours]") == 0.5
)]&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The question is now, can I do the above (get rows where) with identifiers(animal no) and combine it with the table so that I can calculate the correct value for each animal?&lt;/P&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>Tue, 26 Nov 2019 12:33:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-list-of-values-in-formula/m-p/236487#M46669</guid>
      <dc:creator>JulieSAppel</dc:creator>
      <dc:date>2019-11-26T12:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Use list of values in formula</title>
      <link>https://community.jmp.com/t5/Discussions/Use-list-of-values-in-formula/m-p/236518#M46675</link>
      <description>&lt;P&gt;I think adding the formula below to a column in your TSE data test datatable will get you what you want&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Mean( If( :Name( "Time since dosing-[hours]" ) == 0.5, :Name( "DistK-[cm]" ) ), :Animal No. )&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Nov 2019 14:28:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-list-of-values-in-formula/m-p/236518#M46675</guid>
      <dc:creator>wgardnerQS</dc:creator>
      <dc:date>2019-11-26T14:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Use list of values in formula</title>
      <link>https://community.jmp.com/t5/Discussions/Use-list-of-values-in-formula/m-p/236576#M46688</link>
      <description>Not fully clear to me what you want to achieve ultimately.  &lt;BR /&gt;1. In the code above you select rows.You say you want to select rows based on identifiers like Animal Number, correct? &lt;BR /&gt;2. This is done in the table TSE ....jmp. In 6AM you have the sum of the column "DistK-[cm]" by Animal No using a summary table. Is that's what you want to get calculated for the selected Animal Number? &lt;BR /&gt;Thanks for clarification</description>
      <pubDate>Tue, 26 Nov 2019 17:42:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-list-of-values-in-formula/m-p/236576#M46688</guid>
      <dc:creator>martindemel</dc:creator>
      <dc:date>2019-11-26T17:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Use list of values in formula</title>
      <link>https://community.jmp.com/t5/Discussions/Use-list-of-values-in-formula/m-p/236680#M46713</link>
      <description>&lt;P&gt;Actually, for each animal&amp;nbsp;I need to identify the accumulated distance travelled (column "DistK-[cm]")&amp;nbsp;at the last test date at the time that is closest to 6 AM. These values are shown in the "Dist 6 AM" column (and summarized in the 6 AM distance data set (I´m not sure that I need this though)).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I need to adjust it for baseline, meaning, I need to subtract the accumulated distance travelled&amp;nbsp;until 30 min after dosing.&amp;nbsp;&amp;nbsp;For this I would use the "Time since dosing" column, identify the rows where the value in this column equals 0.5 hours&amp;nbsp;(which is what I did with "get rows where"&amp;nbsp;) which provides me a list of values (one value per animal) [1218, 2999, 5368, 2187, 2242, 3457, 3171, 5008, 4022, 3822, 5429, 3060, 2972, 3162, 5659, 2280].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So in this example animal 1 has travelled 43343 cm at 5.58 AM and then I need to subtract the value at 30 min after dosing (in this case the first value in the list:&amp;nbsp;1218 cm). How do I do this in a robust manner? With a loop that iterates through the list?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 13:51:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-list-of-values-in-formula/m-p/236680#M46713</guid>
      <dc:creator>JulieSAppel</dc:creator>
      <dc:date>2019-11-27T13:51:26Z</dc:date>
    </item>
  </channel>
</rss>

