<?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: How to split table and keep all columns with correct information? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-split-table-and-keep-all-columns-with-correct-information/m-p/259445#M50936</link>
    <description>&lt;P&gt;EDIT: I mis-typed one of the column names, "Method", as "group" in the original version of this reply. This edit remedies that error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Apologies,&lt;/P&gt;
&lt;P&gt;Brady&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*****************************************&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Oh, good catch, I did not see that duplication. In that case, yes, you need another column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The way I create that new "differentiator" column that txnelson mentions--without lags, so you don't have to sort the table--is with the formula:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;col cumulative sum ( 1, :ID, :Method, :Name)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Brady&lt;/P&gt;</description>
    <pubDate>Wed, 22 Apr 2020 19:31:58 GMT</pubDate>
    <dc:creator>brady_brady</dc:creator>
    <dc:date>2020-04-22T19:31:58Z</dc:date>
    <item>
      <title>How to split table and keep all columns with correct information?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-split-table-and-keep-all-columns-with-correct-information/m-p/259325#M50923</link>
      <description>&lt;P&gt;I'm trying to split a table by "Method", so each method becomes a new column, with the values associated. But I want to keep all the other columns, ID and Name.&lt;/P&gt;&lt;P&gt;Initial table:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Agustin_0-1587468541593.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/23233i58B67A26A5623A5B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Agustin_0-1587468541593.png" alt="Agustin_0-1587468541593.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Desired split:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Agustin_1-1587468598511.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/23234i8641011B1213F144/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Agustin_1-1587468598511.png" alt="Agustin_1-1587468598511.png" /&gt;&lt;/span&gt;&amp;nbsp;or&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Agustin_2-1587468628834.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/23235iE5D2047E54E37B9F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Agustin_2-1587468628834.png" alt="Agustin_2-1587468628834.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Either of the formats pictured above would work for my purposes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However using the split function:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Agustin_3-1587468670930.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/23236i4EC970F135A2F51C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Agustin_3-1587468670930.png" alt="Agustin_3-1587468670930.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Which gives me wrong results:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Agustin_4-1587468686842.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/23237i390DD73352FDFC54/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Agustin_4-1587468686842.png" alt="Agustin_4-1587468686842.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;For example, ID = 3, B = 222 was done by Jon, not Alice. So the values for ID and Name don't always match the value in the method columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a built-in way of achieving this? It appears to be a fault with the split function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 11:34:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-split-table-and-keep-all-columns-with-correct-information/m-p/259325#M50923</guid>
      <dc:creator>Agustin</dc:creator>
      <dc:date>2020-04-21T11:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to split table and keep all columns with correct information?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-split-table-and-keep-all-columns-with-correct-information/m-p/259403#M50930</link>
      <description>&lt;P&gt;Hi Augustin,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the dialog launch menu, cast the "ID" and "Name" columns into the "Group" role.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;More information can be found on the split function here: &lt;A href="https://www.jmp.com/support/help/en/15.1/index.shtml#page/jmp/examples-of-splitting-columns.shtml" target="_blank"&gt;https://www.jmp.com/support/help/en/15.1/index.shtml#page/jmp/examples-of-splitting-columns.shtml&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Brady&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 13:44:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-split-table-and-keep-all-columns-with-correct-information/m-p/259403#M50930</guid>
      <dc:creator>brady_brady</dc:creator>
      <dc:date>2020-04-21T13:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to split table and keep all columns with correct information?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-split-table-and-keep-all-columns-with-correct-information/m-p/259432#M50934</link>
      <description>&lt;P&gt;If you did not have duplicate values for ID and Name, you could place them into the Group selection box in the Split platform, and get the results you want, but because you have two entries for Bob in ID group 1, you have to create a new column that will differentiate for that.&amp;nbsp; So how I did that was&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;I sorted the data table by ID and Name&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;I created a new formula column called Count and used the formula
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( Row() == 1, counter = 0 );
If( :ID == Lag( :ID ) &amp;amp; :Method == Lag( :Method ) &amp;amp; :Name == Lag( :Name ),
	counter++,
	counter = 1
);
counter;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;It created the following results&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="split1.PNG" style="width: 465px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/23259i64E27AE8B7DB412C/image-size/large?v=v2&amp;amp;px=999" role="button" title="split1.PNG" alt="split1.PNG" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;I then Split the table using ID, Name and Count in the Group selection box&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="split2.PNG" style="width: 531px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/23260iA00DB12F500E5D77/image-size/large?v=v2&amp;amp;px=999" role="button" title="split2.PNG" alt="split2.PNG" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;Which gave me the results&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="split3.PNG" style="width: 721px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/23261i7EE45990AC5567CE/image-size/large?v=v2&amp;amp;px=999" role="button" title="split3.PNG" alt="split3.PNG" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Please note, that I keyed in an incorrect value in the original data table for Bob of 1223 and it should have been 123&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 14:31:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-split-table-and-keep-all-columns-with-correct-information/m-p/259432#M50934</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-04-21T14:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to split table and keep all columns with correct information?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-split-table-and-keep-all-columns-with-correct-information/m-p/259445#M50936</link>
      <description>&lt;P&gt;EDIT: I mis-typed one of the column names, "Method", as "group" in the original version of this reply. This edit remedies that error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Apologies,&lt;/P&gt;
&lt;P&gt;Brady&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*****************************************&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Oh, good catch, I did not see that duplication. In that case, yes, you need another column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The way I create that new "differentiator" column that txnelson mentions--without lags, so you don't have to sort the table--is with the formula:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;col cumulative sum ( 1, :ID, :Method, :Name)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Brady&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 19:31:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-split-table-and-keep-all-columns-with-correct-information/m-p/259445#M50936</guid>
      <dc:creator>brady_brady</dc:creator>
      <dc:date>2020-04-22T19:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to split table and keep all columns with correct information?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-split-table-and-keep-all-columns-with-correct-information/m-p/259831#M50986</link>
      <description>&lt;P&gt;Thank you. I assume in your answer the ":group" should not be there?&lt;/P&gt;&lt;P&gt;Also when I try it without :group I don't get the same numbers as for txnelson's answer.&lt;/P&gt;&lt;P&gt;Could you point me to what is going wrong?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Agustin_0-1587567438917.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/23307i5DB57226A337D2B3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Agustin_0-1587567438917.png" alt="Agustin_0-1587567438917.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 14:58:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-split-table-and-keep-all-columns-with-correct-information/m-p/259831#M50986</guid>
      <dc:creator>Agustin</dc:creator>
      <dc:date>2020-04-22T14:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to split table and keep all columns with correct information?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-split-table-and-keep-all-columns-with-correct-information/m-p/259834#M50988</link>
      <description>Actually where you said group you meant method. It works perfect thank you!</description>
      <pubDate>Wed, 22 Apr 2020 15:20:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-split-table-and-keep-all-columns-with-correct-information/m-p/259834#M50988</guid>
      <dc:creator>Agustin</dc:creator>
      <dc:date>2020-04-22T15:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to split table and keep all columns with correct information?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-split-table-and-keep-all-columns-with-correct-information/m-p/259892#M51010</link>
      <description>&lt;P&gt;Thanks for the heads-up on my error--I've edited the offending post, so it now has the correct formula.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Brady&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 19:33:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-split-table-and-keep-all-columns-with-correct-information/m-p/259892#M51010</guid>
      <dc:creator>brady_brady</dc:creator>
      <dc:date>2020-04-22T19:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to split table and keep all columns with correct information?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-split-table-and-keep-all-columns-with-correct-information/m-p/367704#M61762</link>
      <description>&lt;P&gt;Sorry, just trying to figure out the purpose of "1" in your formula (&lt;SPAN&gt;&lt;STRONG&gt;col cumulative sum ( 1, :ID, :Method, :Name)&lt;/STRONG&gt;)&lt;/SPAN&gt;. Is that the increment to be added for each row where the same combination of ID, Method &amp;amp; Name appears?&lt;BR /&gt;&lt;BR /&gt;I checked the scripting index, but couldn't find info telling me what "1" does. Tested the formula a little and concluded that it's an increment. Is that correct? If yes, where in the scripting index or where at all could I find this information other than in this thread? (Just teaching myself to script, so please excuse foolish question.)&lt;/P&gt;</description>
      <pubDate>Sun, 14 Mar 2021 14:58:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-split-table-and-keep-all-columns-with-correct-information/m-p/367704#M61762</guid>
      <dc:creator>Ressel</dc:creator>
      <dc:date>2021-03-14T14:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to split table and keep all columns with correct information?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-split-table-and-keep-all-columns-with-correct-information/m-p/367705#M61763</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The "1" is in the spot where you would normally place a column. The effect is a column of ones. I don't know if this technique is documented, per se. It is a nice trick to know, however, and I use it all the time in conjunction with cumulative sums to do what I've done here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Brady&lt;/P&gt;</description>
      <pubDate>Sun, 14 Mar 2021 15:02:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-split-table-and-keep-all-columns-with-correct-information/m-p/367705#M61763</guid>
      <dc:creator>brady_brady</dc:creator>
      <dc:date>2021-03-14T15:02:52Z</dc:date>
    </item>
  </channel>
</rss>

