<?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: JSL split function keep column name in header when splitting a single column in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-split-function-keep-column-name-in-header-when-splitting-a/m-p/257888#M50679</link>
    <description>&lt;P&gt;Ok, so I can see what's going on, and I can see why it was developed that way, and also, I can't see a simple way around it. &amp;nbsp;So here's a brute force method, in the least elegant way possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
dt&amp;lt;&amp;lt;new column("blank");
insert into (EmitCols, :blank)   //or some how get :blank into that split list

//do your split here
dt=current data table();
clist=dt&amp;lt;&amp;lt;get column names();
del={};
for (i=1, i&amp;lt;=nitems(clist), i++,
if(contains(clist[i], "blank")&amp;gt;1,insert into(del, clist[i]));
);
dt &amp;lt;&amp;lt; Select Columns( del );
dt &amp;lt;&amp;lt; Delete Columns();&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 14 Apr 2020 14:25:31 GMT</pubDate>
    <dc:creator>Byron_JMP</dc:creator>
    <dc:date>2020-04-14T14:25:31Z</dc:date>
    <item>
      <title>JSL split function keep column name in header when splitting a single column</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-split-function-keep-column-name-in-header-when-splitting-a/m-p/251700#M49423</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I have a section of jsl code which takes my data table and splits a variable amount of columns (code attached below).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//Variable Table splitting operation
dt_split = new &amp;lt;&amp;lt; Split(
Split By( :SamplePos, :File ID ),
Split( Eval List( EmitCols ) ), //Here is the line where I choose a variable amount of columns within the data table to split
Group(:Cycles),
Output Table( "Split_Table" ),
Remaining Columns( keep all ),
Sort by Column Property&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When the columns specified within EmitCols are greater than 1 it returns a data table where the new columns are annotated with the name of each column specified within EmitCols, however when there is only 1 column within EmitCols it omits annotating the new columns with the name. Is there an attribute within the split() function where I can keep the annotations when only splitting out by 1 column? If not, is there a way to over ride this behavior?&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: I have tried searching the scripting index and so far I could not find any attribute of split which allows me to do that.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:26:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-split-function-keep-column-name-in-header-when-splitting-a/m-p/251700#M49423</guid>
      <dc:creator>inqmnd</dc:creator>
      <dc:date>2023-06-09T23:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: JSL split function keep column name in header when splitting a single column</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-split-function-keep-column-name-in-header-when-splitting-a/m-p/257888#M50679</link>
      <description>&lt;P&gt;Ok, so I can see what's going on, and I can see why it was developed that way, and also, I can't see a simple way around it. &amp;nbsp;So here's a brute force method, in the least elegant way possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
dt&amp;lt;&amp;lt;new column("blank");
insert into (EmitCols, :blank)   //or some how get :blank into that split list

//do your split here
dt=current data table();
clist=dt&amp;lt;&amp;lt;get column names();
del={};
for (i=1, i&amp;lt;=nitems(clist), i++,
if(contains(clist[i], "blank")&amp;gt;1,insert into(del, clist[i]));
);
dt &amp;lt;&amp;lt; Select Columns( del );
dt &amp;lt;&amp;lt; Delete Columns();&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Apr 2020 14:25:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-split-function-keep-column-name-in-header-when-splitting-a/m-p/257888#M50679</guid>
      <dc:creator>Byron_JMP</dc:creator>
      <dc:date>2020-04-14T14:25:31Z</dc:date>
    </item>
  </channel>
</rss>

