<?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 How to copy and paste data cells from different ID cells? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-copy-and-paste-data-cells-from-different-ID-cells/m-p/54742#M30953</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have an example of data table enclosed in this post. I need to copy the information from ProTest cells from Phase B to Phase A in the same column. However, first I need to match the Test_IDs following the rule:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Phase A &amp;lt;-&amp;gt; Phase B&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;11&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 13&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;17&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;9 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;19&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have different numbers of participants because of missing data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How can I do it, please?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Apr 2018 14:06:05 GMT</pubDate>
    <dc:creator>Reinaldo</dc:creator>
    <dc:date>2018-04-10T14:06:05Z</dc:date>
    <item>
      <title>How to copy and paste data cells from different ID cells?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-copy-and-paste-data-cells-from-different-ID-cells/m-p/54742#M30953</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have an example of data table enclosed in this post. I need to copy the information from ProTest cells from Phase B to Phase A in the same column. However, first I need to match the Test_IDs following the rule:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Phase A &amp;lt;-&amp;gt; Phase B&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;11&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 13&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;17&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;9 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;19&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have different numbers of participants because of missing data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How can I do it, please?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2018 14:06:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-copy-and-paste-data-cells-from-different-ID-cells/m-p/54742#M30953</guid>
      <dc:creator>Reinaldo</dc:creator>
      <dc:date>2018-04-10T14:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy and paste data cells from different ID cells?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-copy-and-paste-data-cells-from-different-ID-cells/m-p/54829#M30991</link>
      <description>&lt;P&gt;Even though your table is sorted and nice,&amp;nbsp; this script assumes nothing, even allows the possibility that there is no corresponding ProTest.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);
dt = Data Table("example2");

For(i=1, i&amp;lt;=nrow(dt), i++,
 if (:Phase[i] =="A",
 	uid = :Subject_ID[i];
 	tid = :Test_ID[i] +10;
    xx = dt &amp;lt;&amp;lt; get rows where(:Subject_ID ==uid &amp;amp; :Test_ID == tid);
    if(nrow(xx)==1,
      :ProTest[i] = :ProTest[xx[1]]
    );
 ); //end if Phase
); // end For i&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 12:08:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-copy-and-paste-data-cells-from-different-ID-cells/m-p/54829#M30991</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-04-11T12:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy and paste data cells from different ID cells?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-copy-and-paste-data-cells-from-different-ID-cells/m-p/54840#M31000</link>
      <description>&lt;P&gt;Brilliant,&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/70"&gt;@gzmorgan0&lt;/a&gt;! :)&lt;/img&gt;&lt;/P&gt;&lt;P&gt;I have two questions:&lt;/P&gt;&lt;P&gt;1. In case I would like to add more "filters" or "By", should I create more variables (e.g., uid, tid) and insert them into the function "get rows where ( )", adding &amp;amp; "Column name == 'new variable'"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. If the Test_id "cannot" be defined as a logical sequence such as "sum 10" please do you think it is possible to create, for example, before (or inside) "For looping statement" a matrix which associates each Test_id from Phase A to Phase B? In this way, the user could define any association between id's in both phases.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to thank you for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS: It is enclosed in this post a suggestion for following association and I added your script into there:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Phase A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Phase B&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;22&lt;/P&gt;&lt;P&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 55&lt;/P&gt;&lt;P&gt;8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;18&lt;/P&gt;&lt;P&gt;9 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 16:41:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-copy-and-paste-data-cells-from-different-ID-cells/m-p/54840#M31000</guid>
      <dc:creator>Reinaldo</dc:creator>
      <dc:date>2018-04-11T16:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy and paste data cells from different ID cells?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-copy-and-paste-data-cells-from-different-ID-cells/m-p/54851#M31007</link>
      <description>&lt;P&gt;You should look into JMP's associative array. Think of an associative array as a keyed list. You define the key and the associated values. Keys can be strings, expressions, lists, almost anything but numeric decimal values, integers are okay.&amp;nbsp; See the modified script below. In other scripting languages, an associative array is called a dictionary. I use it often.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The answer is yes to your other question, add more filter variables.&lt;/P&gt;&lt;P&gt;Good luck.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);
dt = Data Table("example2_modified");

decode_aa = Associative Array({1,2,5,8,9}, {20,22,55,18,9});

For(i=1, i&amp;lt;=nrow(dt), i++,
 if (:Phase[i] =="A",
 	uid = :Subject_ID[i];
 	tid = decode_aa[ :Test_ID[i] ];
    xx = dt &amp;lt;&amp;lt; get rows where(:Subject_ID ==uid &amp;amp; :Test_ID == tid);
    if(nrow(xx)==1,
      :ProTest[i] = :ProTest[xx[1]]
    );
 ); //end if Phase
); // end For i&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Apr 2018 19:37:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-copy-and-paste-data-cells-from-different-ID-cells/m-p/54851#M31007</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-04-11T19:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy and paste data cells from different ID cells?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-copy-and-paste-data-cells-from-different-ID-cells/m-p/54853#M31009</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/70"&gt;@gzmorgan0&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your solution! Just one score couldn't be copied from Phase B to Phase A. It's Test_id = 9 (equal ids). I didn't understand why.&lt;/P&gt;&lt;P&gt;Your script is attached.&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 20:02:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-copy-and-paste-data-cells-from-different-ID-cells/m-p/54853#M31009</guid>
      <dc:creator>Reinaldo</dc:creator>
      <dc:date>2018-04-11T20:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy and paste data cells from different ID cells?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-copy-and-paste-data-cells-from-different-ID-cells/m-p/54854#M31010</link>
      <description>&lt;P&gt;oops!&amp;nbsp; The script is always getting just the first value which is phase A.&amp;nbsp; So modify the statement with an additional filter &amp;amp; :Phase=="B"&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;    xx = dt &amp;lt;&amp;lt; get rows where(:Subject_ID ==uid &amp;amp; :Test_ID == tid &amp;amp; :Phase=="B");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 20:09:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-copy-and-paste-data-cells-from-different-ID-cells/m-p/54854#M31010</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-04-11T20:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy and paste data cells from different ID cells?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-copy-and-paste-data-cells-from-different-ID-cells/m-p/54855#M31011</link>
      <description>&lt;P&gt;Amazing, &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/70"&gt;@gzmorgan0&lt;/a&gt;!! Worked!!&lt;/P&gt;&lt;P&gt;Where can I learn more about&amp;nbsp;those commands such as&amp;nbsp;&lt;CODE class="  language-jsl"&gt;get rows where () and nrow( )&amp;nbsp;&lt;/CODE&gt;&amp;nbsp;and others to have a full control from rows and columns?&amp;nbsp;Does the nrow( ) accept an integer inside it in case I wish to limit JMP scrolls the vector?&lt;/P&gt;&lt;P&gt;I will try to adapt to my problem... _/\_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 20:24:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-copy-and-paste-data-cells-from-different-ID-cells/m-p/54855#M31011</guid>
      <dc:creator>Reinaldo</dc:creator>
      <dc:date>2018-04-11T20:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy and paste data cells from different ID cells?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-copy-and-paste-data-cells-from-different-ID-cells/m-p/54858#M31013</link>
      <description>&lt;P&gt;oops!&amp;nbsp; The script is always getting just the first value which is phase A.&amp;nbsp; So modify the statement with an additional filter &amp;amp; :Phase=="B"&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;    xx = dt &amp;lt;&amp;lt; get rows where(:Subject_ID ==uid &amp;amp; :Test_ID == tid &amp;amp; :Phase=="B");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 22:43:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-copy-and-paste-data-cells-from-different-ID-cells/m-p/54858#M31013</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-04-11T22:43:30Z</dc:date>
    </item>
  </channel>
</rss>

