<?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 Can this simple two-step operation be done in one step? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Can-this-simple-two-step-operation-be-done-in-one-step/m-p/745713#M92552</link>
    <description>&lt;P&gt;Can it be done with memory arrays?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
ca = "sex";
dt &amp;lt;&amp;lt; Select Where( Row() &amp;lt; 25 );
dt &amp;lt;&amp;lt; Select Columns( ca );
d3 = dt &amp;lt;&amp;lt; Subset( Output Table( "b3" ), Selected Rows( 1 ), columns( ca ) );
d2 = d3 &amp;lt;&amp;lt; Summary(
	Group( 1 ),
	Freq( 0 ),
	Weight( 0 ),
	Link to original data table( 0 ),
	Output Table( "b2" )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;Is there no need to generate d3?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
    <pubDate>Wed, 10 Apr 2024 06:17:51 GMT</pubDate>
    <dc:creator>lala</dc:creator>
    <dc:date>2024-04-10T06:17:51Z</dc:date>
    <item>
      <title>Can this simple two-step operation be done in one step?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-this-simple-two-step-operation-be-done-in-one-step/m-p/745713#M92552</link>
      <description>&lt;P&gt;Can it be done with memory arrays?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
ca = "sex";
dt &amp;lt;&amp;lt; Select Where( Row() &amp;lt; 25 );
dt &amp;lt;&amp;lt; Select Columns( ca );
d3 = dt &amp;lt;&amp;lt; Subset( Output Table( "b3" ), Selected Rows( 1 ), columns( ca ) );
d2 = d3 &amp;lt;&amp;lt; Summary(
	Group( 1 ),
	Freq( 0 ),
	Weight( 0 ),
	Link to original data table( 0 ),
	Output Table( "b2" )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;Is there no need to generate d3?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 10 Apr 2024 06:17:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-this-simple-two-step-operation-be-done-in-one-step/m-p/745713#M92552</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-04-10T06:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Can this simple two-step operation be done in one step?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-this-simple-two-step-operation-be-done-in-one-step/m-p/745724#M92553</link>
      <description>&lt;P&gt;What do you want to do?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: create summary table?&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 07:01:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-this-simple-two-step-operation-be-done-in-one-step/m-p/745724#M92553</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-04-10T07:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can this simple two-step operation be done in one step?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-this-simple-two-step-operation-be-done-in-one-step/m-p/745766#M92554</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;I want to extract a subset of the data in this column, and then aggregate the respective numbers of these subsets.&lt;/SPAN&gt;&lt;SPAN class=""&gt;Note that the format of this column is text.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 08:29:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-this-simple-two-step-operation-be-done-in-one-step/m-p/745766#M92554</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-04-10T08:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: Can this simple two-step operation be done in one step?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-this-simple-two-step-operation-be-done-in-one-step/m-p/745781#M92555</link>
      <description>&lt;P&gt;Do you want them in table? Do you need the subset (you mentioned you want to "extract a subset")?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 08:50:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-this-simple-two-step-operation-be-done-in-one-step/m-p/745781#M92555</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-04-10T08:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can this simple two-step operation be done in one step?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-this-simple-two-step-operation-be-done-in-one-step/m-p/745805#M92556</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;Subsets may not appear.&lt;/SPAN&gt;&lt;SPAN class=""&gt;However, the final breakdown needs to be presented as a table of data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 09:51:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-this-simple-two-step-operation-be-done-in-one-step/m-p/745805#M92556</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-04-10T09:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can this simple two-step operation be done in one step?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-this-simple-two-step-operation-be-done-in-one-step/m-p/745813#M92557</link>
      <description>&lt;P&gt;Here are few options, but it is very easy to come up with even more (also I'm not sure what would be the issue of using subset as you can create it as private and close it immediately after you have the subset)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
groupcol = "sex";

// Filter
dt_filter = dt &amp;lt;&amp;lt; Summary(
	Local Data Filter(
		Add Filter(
			columns(Transform Column("Row", Formula(Row()))),
			Where(Transform Column("Row", Formula(Row())) &amp;lt; 25)
		)
	),
	Group(Eval(groupcol)),
	Freq("None"),
	Weight("None"),
	Link to original data table(0),
	Output table("1")
);

// Exclude
dt &amp;lt;&amp;lt; Select Where(Row() &amp;gt;= 25) &amp;lt;&amp;lt; Hide and Exclude(1);
dt_exclude = dt &amp;lt;&amp;lt; Summary(
	Group(Eval(groupcol)),
	Freq("None"),
	Weight("None"),
	Link to original data table(0),
	Output table("2")
);
dt &amp;lt;&amp;lt; Clear Row States;

// SQL
dt_sql = Query(
	Table(dt, "bc"),
	Eval Insert("\[
	SELECT ^groupcol^, COUNT(rowid) "N Rows"
	FROM bc
	WHERE ROWID &amp;lt; 25
	GROUP BY ^groupcol^
	]\")
);
dt_sql &amp;lt;&amp;lt; Set Name("3");


// Summarize and transform (could also use exclude)
dt &amp;lt;&amp;lt; Transform Column("A", Formula(If(Row() &amp;lt; 25, 1, .)));
Summarize(dt, groups = By(Eval(groupcol)), counts = Sum(:A)); // Summarize requires numeric columns
dt_summarize = New Table("4",
	New Column(groupcol, Character, Nominal, Values(groups)),
	New Column("N Rows", Numeric, Continuous, Values(counts))	
);
dt &amp;lt;&amp;lt; Delete Columns(:A);

Write();&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Apr 2024 09:55:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-this-simple-two-step-operation-be-done-in-one-step/m-p/745813#M92557</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-04-10T09:55:55Z</dc:date>
    </item>
  </channel>
</rss>

