<?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 Function to copy down data based on a selection criteria in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Function-to-copy-down-data-based-on-a-selection-criteria/m-p/342947#M59214</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would it be possible to create a function, script or column formula to copy over information from a column based on a selection that is made in other columns. Some sort of VLOOKUP function if I would need to describe this. I have attached a JMP table as an example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to populate the &lt;STRONG&gt;Adjusted Time&lt;/STRONG&gt; column with data from the &lt;STRONG&gt;Time&lt;/STRONG&gt; column. And this should be done in a manner that if Stage = &lt;STRONG&gt;PR&lt;/STRONG&gt; it should just copy over the exact data for each row as in the Time column. But if Stage = &lt;STRONG&gt;SL&lt;/STRONG&gt; it should copy down the time where Step = &lt;STRONG&gt;P0 &lt;/STRONG&gt;(for each SL row) . If Stage = &lt;STRONG&gt;ST&amp;nbsp;&lt;/STRONG&gt;it should copy down the time where Step = &lt;STRONG&gt;R1 &lt;/STRONG&gt;(for each ST row). This would also need to be done for each &lt;STRONG&gt;Experiment Number&lt;/STRONG&gt; separately.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would it furthermore be possible to generate a warning message if there is no Step = P0 or Step = R1 available in the current data table (eg. Experiment Number 2)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Much appreciated if someone could help me out or get me started with writing this script or formula.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;</description>
    <pubDate>Sat, 10 Jun 2023 23:23:58 GMT</pubDate>
    <dc:creator>RobRobeyns</dc:creator>
    <dc:date>2023-06-10T23:23:58Z</dc:date>
    <item>
      <title>Function to copy down data based on a selection criteria</title>
      <link>https://community.jmp.com/t5/Discussions/Function-to-copy-down-data-based-on-a-selection-criteria/m-p/342947#M59214</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would it be possible to create a function, script or column formula to copy over information from a column based on a selection that is made in other columns. Some sort of VLOOKUP function if I would need to describe this. I have attached a JMP table as an example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to populate the &lt;STRONG&gt;Adjusted Time&lt;/STRONG&gt; column with data from the &lt;STRONG&gt;Time&lt;/STRONG&gt; column. And this should be done in a manner that if Stage = &lt;STRONG&gt;PR&lt;/STRONG&gt; it should just copy over the exact data for each row as in the Time column. But if Stage = &lt;STRONG&gt;SL&lt;/STRONG&gt; it should copy down the time where Step = &lt;STRONG&gt;P0 &lt;/STRONG&gt;(for each SL row) . If Stage = &lt;STRONG&gt;ST&amp;nbsp;&lt;/STRONG&gt;it should copy down the time where Step = &lt;STRONG&gt;R1 &lt;/STRONG&gt;(for each ST row). This would also need to be done for each &lt;STRONG&gt;Experiment Number&lt;/STRONG&gt; separately.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would it furthermore be possible to generate a warning message if there is no Step = P0 or Step = R1 available in the current data table (eg. Experiment Number 2)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Much appreciated if someone could help me out or get me started with writing this script or formula.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:23:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Function-to-copy-down-data-based-on-a-selection-criteria/m-p/342947#M59214</guid>
      <dc:creator>RobRobeyns</dc:creator>
      <dc:date>2023-06-10T23:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Function to copy down data based on a selection criteria</title>
      <link>https://community.jmp.com/t5/Discussions/Function-to-copy-down-data-based-on-a-selection-criteria/m-p/342970#M59216</link>
      <description>&lt;P&gt;Here is a formula that does what you want, and if there is not a proper look up value found, it changes the cell color to red.&amp;nbsp; Formula below and attached data table&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="adjusted.PNG" style="width: 715px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/29035i8B010C88F8678C26/image-size/large?v=v2&amp;amp;px=999" role="button" title="adjusted.PNG" alt="adjusted.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;curExp = :Experiment Number;
curStage = :Stage;
:Adjusted Time &amp;lt;&amp;lt; color cells( "White", Row() );
at = .;
If(
	:Stage == "PR", at = :Time,
	:Stage == "SL",
		row = Current Data Table() &amp;lt;&amp;lt; get rows where( :Experiment Number == curExp &amp;amp; :Stage == "SL" &amp;amp; :Step == "P0" );
		If( N Rows( row ) &amp;gt; 0,
			at = :Time[row[1]],
			:Adjusted Time &amp;lt;&amp;lt; Color Cells( "Red", Row() )
		);,
	:Stage == "ST",
		row = Current Data Table() &amp;lt;&amp;lt; get rows where( :Experiment Number == curExp &amp;amp; :Stage == "ST" &amp;amp; :Step == "R1" );
		If( N Rows( row ) &amp;gt; 0,
			at = :Time[row[1]],
			:Adjusted Time &amp;lt;&amp;lt; Color Cells( "Red", Row() )
		);
);
at;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 18 Dec 2020 11:19:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Function-to-copy-down-data-based-on-a-selection-criteria/m-p/342970#M59216</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-12-18T11:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: Function to copy down data based on a selection criteria</title>
      <link>https://community.jmp.com/t5/Discussions/Function-to-copy-down-data-based-on-a-selection-criteria/m-p/342971#M59217</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the fast respons. This works really great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However the red colored cells seem to be locked for manual data entry. Would there be a way to bypass this?&lt;/P&gt;&lt;P&gt;I would like to enter a date time value myself whenever this happens.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 11:43:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Function-to-copy-down-data-based-on-a-selection-criteria/m-p/342971#M59217</guid>
      <dc:creator>RobRobeyns</dc:creator>
      <dc:date>2020-12-18T11:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Function to copy down data based on a selection criteria</title>
      <link>https://community.jmp.com/t5/Discussions/Function-to-copy-down-data-based-on-a-selection-criteria/m-p/342986#M59222</link>
      <description>&lt;OL&gt;
&lt;LI&gt;Since the column's values are created by a formula, the only way to keep it as a formula based column and to correct the values, would be to add in the P0 and R1 rows that are missing, and once you did that, the cell colors would go away.&lt;/LI&gt;
&lt;LI&gt;If you need to use manual entry to correct the individual cell values, you will need to change the columns values into static values.&amp;nbsp; This is easily done by
&lt;OL&gt;
&lt;LI&gt;Double click on the Column Header to open the Column Info window.&lt;/LI&gt;
&lt;LI&gt;Go to the Column Properties area, and specify to Remove the formula by clicking on the Remove button&lt;/LI&gt;
&lt;LI&gt;Click on OK to close the Column Info window&lt;/LI&gt;
&lt;LI&gt;You can now change the cell values by typing on them, and change the cell color by right clicking on the cell and selecting Cell Color&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;I strongly recommend you take the time to read the Discovering JMP and Using JMP documents available in the JMP Documentation Library under the Help pull down menu.&amp;nbsp; You will find that it will make your entry into the JMP world easier and more pleasant.&amp;nbsp; It will also show you, that while JMP and Excel are different from each other, they are both are very powerful tools.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 15:55:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Function-to-copy-down-data-based-on-a-selection-criteria/m-p/342986#M59222</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-12-18T15:55:03Z</dc:date>
    </item>
  </channel>
</rss>

