<?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 Split One Column and Transpose it as Header in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Split-One-Column-and-Transpose-it-as-Header/m-p/415521#M66459</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having problem to split columns and transpose it as header and value. Need help here how to write the code.&lt;/P&gt;&lt;P&gt;My data table has four columns, Item, Part Number, Order Number and Quantity.&lt;/P&gt;&lt;P&gt;I need to split Order Number and transpose it as header in new column and split Quantity column transpose it to respective cell.&lt;/P&gt;&lt;P&gt;I attach my data table here and required outcome for your reference.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know this can be done by using Tabulate (). But I do not want to use it because I need my outcome data table is able to link to the original data table for further processing.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35536i8BFFBFE73DC658B5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 19:55:59 GMT</pubDate>
    <dc:creator>Lino</dc:creator>
    <dc:date>2023-06-09T19:55:59Z</dc:date>
    <item>
      <title>Split One Column and Transpose it as Header</title>
      <link>https://community.jmp.com/t5/Discussions/Split-One-Column-and-Transpose-it-as-Header/m-p/415521#M66459</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having problem to split columns and transpose it as header and value. Need help here how to write the code.&lt;/P&gt;&lt;P&gt;My data table has four columns, Item, Part Number, Order Number and Quantity.&lt;/P&gt;&lt;P&gt;I need to split Order Number and transpose it as header in new column and split Quantity column transpose it to respective cell.&lt;/P&gt;&lt;P&gt;I attach my data table here and required outcome for your reference.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know this can be done by using Tabulate (). But I do not want to use it because I need my outcome data table is able to link to the original data table for further processing.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35536i8BFFBFE73DC658B5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:55:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Split-One-Column-and-Transpose-it-as-Header/m-p/415521#M66459</guid>
      <dc:creator>Lino</dc:creator>
      <dc:date>2023-06-09T19:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: Split One Column and Transpose it as Header</title>
      <link>https://community.jmp.com/t5/Discussions/Split-One-Column-and-Transpose-it-as-Header/m-p/415536#M66460</link>
      <description>&lt;P&gt;What you want can be accomplished using the&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Tables=&amp;gt;Split&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1630733183189.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35537i8E626CF1FE4F430D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1630733183189.png" alt="txnelson_0-1630733183189.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is a simple script taking the JSL provided from the Split Platform, and then just adding on the JSL taken from the Recode feature&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

// Get the column names that will need to recoded to 0 if missing
Summarize( dt, colnames = by( :Order Number ) );

// Do the simple split to transform the data table
dtSplit = dt &amp;lt;&amp;lt; Split(
	Split By( :Order Number ),
	Split( :Quantity ),
	Group( :Item, :Part Number ),
	Sort by Column Property
);

// Loop across all split columns and recode missing values to zeros
For( i = 1, i &amp;lt;= N Items( colnames ), i++,
	dtSplit &amp;lt;&amp;lt; Begin Data Update;
	dtSplit &amp;lt;&amp;lt; Recode Column(
		As Column( dtSplit, colnames[i] ),
		{Map Value( _rcOrig, {., 0}, Unmatched( _rcNow ) )},
		Update Properties( 1 ),
		Target Column( As Column( dtSplit, colnames[i] ) )
	);
	dt &amp;lt;&amp;lt; End Data Update;
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 04 Sep 2021 05:28:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Split-One-Column-and-Transpose-it-as-Header/m-p/415536#M66460</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-09-04T05:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: Split One Column and Transpose it as Header</title>
      <link>https://community.jmp.com/t5/Discussions/Split-One-Column-and-Transpose-it-as-Header/m-p/415540#M66461</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure I understand your problem: if you do a simple Split of column Quantity by "Order Number" and group by "Item" and "Part Number" you get the outcome as shown in your post with the exception that the missing values are coded as "missing" and not "0".&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thierry_S_0-1630733524994.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35539i906F34321961B54E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thierry_S_0-1630733524994.png" alt="Thierry_S_0-1630733524994.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;With a simple Recode from the Standardize Attributes, you can set all missing values to zero.&lt;/P&gt;
&lt;P&gt;Assuming that I did not understand your initial request, could you clarify what part of the process did not work for you?&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;TS&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 05:32:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Split-One-Column-and-Transpose-it-as-Header/m-p/415540#M66461</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2021-09-04T05:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: Split One Column and Transpose it as Header</title>
      <link>https://community.jmp.com/t5/Discussions/Split-One-Column-and-Transpose-it-as-Header/m-p/415545#M66462</link>
      <description>&lt;P&gt;Thanks Jim&lt;/P&gt;&lt;P&gt;Thanks TS&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 05:59:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Split-One-Column-and-Transpose-it-as-Header/m-p/415545#M66462</guid>
      <dc:creator>Lino</dc:creator>
      <dc:date>2021-09-04T05:59:47Z</dc:date>
    </item>
  </channel>
</rss>

