<?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 Beginner JSL query in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Beginner-JSL-query/m-p/447689#M69445</link>
    <description>&lt;P&gt;I want to save selected rows from a table in a jmp file and also the inversion of the selected rows in another jmp file after using the partition function. I went through some examples and other threads but I am not able to save the selected rows and the inverted rows. I must be doing something wrong. Does anyone have any idea how it can be done in JSL?&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 );
dt = Open( "C:/Users/Desktop/driver/MASTER.jmp" );
f = Function({a}, theRows = Current Data Table() &amp;lt;&amp;lt; get selected rows;
Show(theRows);

);
obj = Partition(

       Y( :Failed ),

       X(
             :VOLUME,

             :FAMILY,

             :CONFIG

       ),

       Method( "Decision Tree" ),

       Validation Portion( .2 )

);

obj &amp;lt;&amp;lt; ShowGraph( 0 );

obj &amp;lt;&amp;lt; SplitBest( 4 );
 
obj &amp;lt;&amp;lt; on close( Clear Symbols( rs ) );

 

action = 0;

actionsubset = 0;

 

look_window = New Window( "Decision",

       Lineup Box( N Col( 1 ),

             V List Box(

                    Text Box( "After selection of the rows,go for Plot?" ),

                    H List Box(

                          spacer box(size(100,5)),

                          Button Box( "Continue",

                                 action = 1;

                                 look_window &amp;lt;&amp;lt; close window;

                                 //obj &amp;lt;&amp;lt; Save( "C:\Users\Desktop\test.csv" );

                                 //filepath = "C:\Users\Desktop\driver";

                                 //rs &amp;lt;&amp;lt; save( filepath || "\" || "p1.jmp" );

                                

                                 Include("C:/Users/Desktop/driver/plot.jsl");

                                

                          ),

                          Button Box( "Close",

                                 action = 2;

                                 Close( obj, nosave );

                         

                                 //Throw( "You cancelled the script." );

                          ),

                    )

             ),

 

       )

);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 10 Jun 2023 23:42:01 GMT</pubDate>
    <dc:creator>AnovaPorpoise</dc:creator>
    <dc:date>2023-06-10T23:42:01Z</dc:date>
    <item>
      <title>Beginner JSL query</title>
      <link>https://community.jmp.com/t5/Discussions/Beginner-JSL-query/m-p/447689#M69445</link>
      <description>&lt;P&gt;I want to save selected rows from a table in a jmp file and also the inversion of the selected rows in another jmp file after using the partition function. I went through some examples and other threads but I am not able to save the selected rows and the inverted rows. I must be doing something wrong. Does anyone have any idea how it can be done in JSL?&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 );
dt = Open( "C:/Users/Desktop/driver/MASTER.jmp" );
f = Function({a}, theRows = Current Data Table() &amp;lt;&amp;lt; get selected rows;
Show(theRows);

);
obj = Partition(

       Y( :Failed ),

       X(
             :VOLUME,

             :FAMILY,

             :CONFIG

       ),

       Method( "Decision Tree" ),

       Validation Portion( .2 )

);

obj &amp;lt;&amp;lt; ShowGraph( 0 );

obj &amp;lt;&amp;lt; SplitBest( 4 );
 
obj &amp;lt;&amp;lt; on close( Clear Symbols( rs ) );

 

action = 0;

actionsubset = 0;

 

look_window = New Window( "Decision",

       Lineup Box( N Col( 1 ),

             V List Box(

                    Text Box( "After selection of the rows,go for Plot?" ),

                    H List Box(

                          spacer box(size(100,5)),

                          Button Box( "Continue",

                                 action = 1;

                                 look_window &amp;lt;&amp;lt; close window;

                                 //obj &amp;lt;&amp;lt; Save( "C:\Users\Desktop\test.csv" );

                                 //filepath = "C:\Users\Desktop\driver";

                                 //rs &amp;lt;&amp;lt; save( filepath || "\" || "p1.jmp" );

                                

                                 Include("C:/Users/Desktop/driver/plot.jsl");

                                

                          ),

                          Button Box( "Close",

                                 action = 2;

                                 Close( obj, nosave );

                         

                                 //Throw( "You cancelled the script." );

                          ),

                    )

             ),

 

       )

);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:42:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Beginner-JSL-query/m-p/447689#M69445</guid>
      <dc:creator>AnovaPorpoise</dc:creator>
      <dc:date>2023-06-10T23:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Beginner JSL query</title>
      <link>https://community.jmp.com/t5/Discussions/Beginner-JSL-query/m-p/447758#M69453</link>
      <description>&lt;P&gt;The first item I can see, is that you are setting the variable "obj" to be a pointer to the output report for the Partition platform, and then in the New Window, you are using "obj" as if it is a pointer to your data table.&amp;nbsp; The pointer to your data table is the variable "dt" created when you opened the table.&lt;/P&gt;
&lt;P&gt;Below is a simple example that shows a simple way to create a data table from selected rows, and then to create another data table from the inverse of that selection&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );

dt &amp;lt;&amp;lt; select where( :sex == "F" );

dtF = dt &amp;lt;&amp;lt; subset( selected rows( 1 ), selected columns( 0 ) );

dt &amp;lt;&amp;lt; invert row selection;

dtM = dt &amp;lt;&amp;lt; subset( selected rows( 1 ), selected columns( 0 ) );

close( dt, nosave );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Dec 2021 13:53:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Beginner-JSL-query/m-p/447758#M69453</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-12-22T13:53:11Z</dc:date>
    </item>
  </channel>
</rss>

