<?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 How do I get rows based on dynamic column selection in JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-get-rows-based-on-dynamic-column-selection-in-JSL/m-p/896996#M105709</link>
    <description>&lt;P&gt;In a JMP script I would like to retrieve the rows matching a certain criteria specified by user. I would like to do something similar to this:&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( "$SAMPLE_DATA/Big Class.jmp" );
r = dt &amp;lt;&amp;lt; Get Rows Where( :sex == "M" );
Show( r );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Only where the criteria is selected by the user, i.e. the column ("sex") and the target value ("M") should be dynamic. I have tried this without luck:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;colname=Column(dt,"sex");
target="M";
r2 = dt &amp;lt;&amp;lt; Get Rows Where( colname == target );
show(r2);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What am I doing wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Aug 2025 07:14:29 GMT</pubDate>
    <dc:creator>peter_t</dc:creator>
    <dc:date>2025-08-26T07:14:29Z</dc:date>
    <item>
      <title>How do I get rows based on dynamic column selection in JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-get-rows-based-on-dynamic-column-selection-in-JSL/m-p/896996#M105709</link>
      <description>&lt;P&gt;In a JMP script I would like to retrieve the rows matching a certain criteria specified by user. I would like to do something similar to this:&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( "$SAMPLE_DATA/Big Class.jmp" );
r = dt &amp;lt;&amp;lt; Get Rows Where( :sex == "M" );
Show( r );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Only where the criteria is selected by the user, i.e. the column ("sex") and the target value ("M") should be dynamic. I have tried this without luck:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;colname=Column(dt,"sex");
target="M";
r2 = dt &amp;lt;&amp;lt; Get Rows Where( colname == target );
show(r2);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What am I doing wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Aug 2025 07:14:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-get-rows-based-on-dynamic-column-selection-in-JSL/m-p/896996#M105709</guid>
      <dc:creator>peter_t</dc:creator>
      <dc:date>2025-08-26T07:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get rows based on dynamic column selection in JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-get-rows-based-on-dynamic-column-selection-in-JSL/m-p/897024#M105710</link>
      <description>&lt;P&gt;Issue is with your colname&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("$SAMPLE_DATA/Big Class.jmp");

colname = Column(dt, "sex");
target = "M";
r2 = dt &amp;lt;&amp;lt; Get Rows Where(As Column(colname) == target);
Show(r2);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or in my opinion better option&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

colname = "sex";
target = "M";

r2 = dt &amp;lt;&amp;lt; Get Rows Where(As Column(dt, colname) == target);
Show(r2);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

colname = "sex";
target = "M";

r2 = dt &amp;lt;&amp;lt; Get Rows Where(Column(dt, colname)[Row()] == target);
Show(r2);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Aug 2025 09:25:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-get-rows-based-on-dynamic-column-selection-in-JSL/m-p/897024#M105710</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-08-26T09:25:34Z</dc:date>
    </item>
  </channel>
</rss>

