<?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: Split table based on Column Names list in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Split-table-based-on-Column-Names-list/m-p/445228#M69322</link>
    <description>&lt;P&gt;Hadley, this was exactly what I was looking for.&lt;/P&gt;&lt;P&gt;Thank you very much and also thanks for sharing the post about&amp;nbsp;&lt;SPAN&gt;Eval(Eval Expr(Expr())). This will come in handy in my future scripting adventures!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Dec 2021 10:44:40 GMT</pubDate>
    <dc:creator>Pim</dc:creator>
    <dc:date>2021-12-15T10:44:40Z</dc:date>
    <item>
      <title>Split table based on Column Names list</title>
      <link>https://community.jmp.com/t5/Discussions/Split-table-based-on-Column-Names-list/m-p/444901#M69284</link>
      <description>&lt;P&gt;Hi JMP community, hope you can help me with this problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have made a script that allows users to calculate 1x, 2x and/or 3x SD-values for several sample concentrations with a given (to be entered) factor. The 1x, 2x and/or 3x SD-values can all be chosen via 3 check boxes. This first part works perfectly.&lt;/P&gt;
&lt;P&gt;Based on the selected amount of check boxes, the resulting data table gives a variable amount of columns that I would like to split into a new data table.&lt;/P&gt;
&lt;P&gt;I tried to build a second script that splits the data table based on all SD-columns present (always starting from column 3) but without success. This is my script so far:&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;Names Default To Here( 1 );

dt1 = Data Table( "SD Calculation" );

//Get list of Column names
ColList = dt1 &amp;lt;&amp;lt; Get Column Names();

//Split dt1 based on ColList
dt2 = Data Table( "SD Calculation" ) &amp;lt;&amp;lt; Split(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    Split By( :nomRP ), 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    Split( ColList[3] ), 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    Remaining Columns( Drop All ), 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    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;The resulting splitted table looks like this and is missing most of the data:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pim_0-1639488490179.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38403iABC22D8539EEA985/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Pim_0-1639488490179.png" alt="Pim_0-1639488490179.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what it should look like (I can only achieve this by specifying all column names, however, not all columns are going to be present in each table (it’s based on user selection):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pim_3-1639488623082.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38406i7D5EFEDE9E5A40A6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Pim_3-1639488623082.png" alt="Pim_3-1639488623082.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;When all SD calculations are chosen (±1-3 SD for 5 sample concentrations), 30 columns should be present.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The goal for my script:&lt;/P&gt;
&lt;P&gt;nomRP values are: 50, 71, 100, 141 and 200 and 1-3x SD values can be calculated for each of those nomRP values. All the calculated results should be split in a new data table. With these data I want to build a figure in the Graph Builder showing ranges based on the calculated SD values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pim.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Edit: "SD Calculation" table added.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:41:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Split-table-based-on-Column-Names-list/m-p/444901#M69284</guid>
      <dc:creator>Pim</dc:creator>
      <dc:date>2023-06-10T23:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Split table based on Column Names list</title>
      <link>https://community.jmp.com/t5/Discussions/Split-table-based-on-Column-Names-list/m-p/444950#M69292</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think this is one of those times that Eval(Eval Expr(Expr())) would help.&amp;nbsp; Take a look at the code below and see if it does what you're hoping.&amp;nbsp; Also &lt;A href="https://community.jmp.com/t5/JSL-Cookbook/Insert-one-expression-into-another-using-Eval-Insert-Eval-Expr/ta-p/48998" target="_self"&gt;here's a post&lt;/A&gt; on this topic that explains these types of methods.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

dt1=Data Table("SD Calculation");

 

//Get list of Column names

ColList=dt1&amp;lt;&amp;lt;Get Column Names();

ColList=remove(ColList,1,2);
//Split dt1 based on ColList


eval(eval expr(dt2=Data Table( "SD Calculation" ) &amp;lt;&amp;lt; Split(

       Split By( :nomRP ),

       Split(expr(ColList)),

       Remaining Columns( Drop All ),

       Sort by Column Property

);));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Dec 2021 14:56:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Split-table-based-on-Column-Names-list/m-p/444950#M69292</guid>
      <dc:creator>HadleyMyers</dc:creator>
      <dc:date>2021-12-14T14:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Split table based on Column Names list</title>
      <link>https://community.jmp.com/t5/Discussions/Split-table-based-on-Column-Names-list/m-p/445228#M69322</link>
      <description>&lt;P&gt;Hadley, this was exactly what I was looking for.&lt;/P&gt;&lt;P&gt;Thank you very much and also thanks for sharing the post about&amp;nbsp;&lt;SPAN&gt;Eval(Eval Expr(Expr())). This will come in handy in my future scripting adventures!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 10:44:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Split-table-based-on-Column-Names-list/m-p/445228#M69322</guid>
      <dc:creator>Pim</dc:creator>
      <dc:date>2021-12-15T10:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: Split table based on Column Names list</title>
      <link>https://community.jmp.com/t5/Discussions/Split-table-based-on-Column-Names-list/m-p/672246#M86003</link>
      <description>&lt;P&gt;Many thanks Pim/Hadley for the question/answer on this topic!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I realize this is an old post, but wanted to leave a crumb for anyone who comes after.&lt;/P&gt;&lt;P&gt;I was trying to do something similar to this today, along the lines of Hadley's solution posted above, and at the same time understand the nested&amp;nbsp;&lt;SPAN&gt;Eval(Eval Expr(Expr())) approach (still working on the latter...).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;After playing around a little, I found that this:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt2 = Data Table( "SD Calculation" ) &amp;lt;&amp;lt; Split(
    Split By( :nomRP ),
    Split(Eval Expr(ColList)),
	Remaining Columns( Drop All ),
    Sort by Column Property
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Gives me the same result as this from Hadley's solution:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval(
	Eval Expr(
		dt2 = Data Table( "SD Calculation" ) &amp;lt;&amp;lt; Split(
			Split By( :nomRP ),
			Split(expr(ColList)),
			Remaining Columns( Drop 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;</description>
      <pubDate>Tue, 29 Aug 2023 18:01:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Split-table-based-on-Column-Names-list/m-p/672246#M86003</guid>
      <dc:creator>jc510_2</dc:creator>
      <dc:date>2023-08-29T18:01:31Z</dc:date>
    </item>
  </channel>
</rss>

