<?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 Using dt &amp;lt;&amp;lt; select where() in for loop while looping through columns in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Using-dt-lt-lt-select-where-in-for-loop-while-looping-through/m-p/248823#M48845</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to run a similar script like below where I loop through a list of columns, select where they meet a certain criteria and hide/exclude them accordingly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my script there are calculations and graphical outputs created and for all of those I'm able to use the approach to select a column and compute it as I show below.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Except for the select where() part:&lt;/P&gt;
&lt;P&gt;- If I use the :column(&lt;FONT&gt;col_w&lt;/FONT&gt;) it ignores it&lt;/P&gt;
&lt;P&gt;- If I use :name(&lt;FONT&gt;col_w&lt;/FONT&gt;) it gives an error that it needs a quoted string and I can't get it to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How would I properly script it to get the select where to work?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Ole&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
col_w = List( "age", "height", "weight" );
For( i = 3, i &amp;lt;= N Items( col_w ), i++, 
    //i = 1;
	cur_col = (col_w[i]);
    //cur_col1 = column(col_w[i]);
	dt &amp;lt;&amp;lt; select where( :column( cur_col ) &amp;gt; 1 ) &amp;lt;&amp;lt; hide;
	&amp;lt;&amp;lt;exclude;
    //dt &amp;lt;&amp;lt; select where ( :name(cur_col) &amp;gt; 1) &amp;lt;&amp;lt; hide; &amp;lt;&amp;lt; exclude;
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Mon, 24 Feb 2020 12:46:12 GMT</pubDate>
    <dc:creator>Ole</dc:creator>
    <dc:date>2020-02-24T12:46:12Z</dc:date>
    <item>
      <title>Using dt &lt;&lt; select where() in for loop while looping through columns</title>
      <link>https://community.jmp.com/t5/Discussions/Using-dt-lt-lt-select-where-in-for-loop-while-looping-through/m-p/248823#M48845</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to run a similar script like below where I loop through a list of columns, select where they meet a certain criteria and hide/exclude them accordingly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my script there are calculations and graphical outputs created and for all of those I'm able to use the approach to select a column and compute it as I show below.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Except for the select where() part:&lt;/P&gt;
&lt;P&gt;- If I use the :column(&lt;FONT&gt;col_w&lt;/FONT&gt;) it ignores it&lt;/P&gt;
&lt;P&gt;- If I use :name(&lt;FONT&gt;col_w&lt;/FONT&gt;) it gives an error that it needs a quoted string and I can't get it to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How would I properly script it to get the select where to work?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Ole&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
col_w = List( "age", "height", "weight" );
For( i = 3, i &amp;lt;= N Items( col_w ), i++, 
    //i = 1;
	cur_col = (col_w[i]);
    //cur_col1 = column(col_w[i]);
	dt &amp;lt;&amp;lt; select where( :column( cur_col ) &amp;gt; 1 ) &amp;lt;&amp;lt; hide;
	&amp;lt;&amp;lt;exclude;
    //dt &amp;lt;&amp;lt; select where ( :name(cur_col) &amp;gt; 1) &amp;lt;&amp;lt; hide; &amp;lt;&amp;lt; exclude;
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 24 Feb 2020 12:46:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-dt-lt-lt-select-where-in-for-loop-while-looping-through/m-p/248823#M48845</guid>
      <dc:creator>Ole</dc:creator>
      <dc:date>2020-02-24T12:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using dt &lt;&lt; select where() in for loop while looping through columns</title>
      <link>https://community.jmp.com/t5/Discussions/Using-dt-lt-lt-select-where-in-for-loop-while-looping-through/m-p/248825#M48846</link>
      <description>&lt;P&gt;Your For() loop needs to start with I=1.&lt;/P&gt;
&lt;P&gt;Here is the proper form for your Select Where:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; select where ( as column(cur_col) &amp;gt; 1); column(dt,cur_col) &amp;lt;&amp;lt; hide &amp;lt;&amp;lt; exclude;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 22 Feb 2020 17:58:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-dt-lt-lt-select-where-in-for-loop-while-looping-through/m-p/248825#M48846</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-02-22T17:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using dt &lt;&lt; select where() in for loop while looping through columns</title>
      <link>https://community.jmp.com/t5/Discussions/Using-dt-lt-lt-select-where-in-for-loop-while-looping-through/m-p/248846#M48852</link>
      <description>&lt;P&gt;Perf&lt;FONT&gt;ect. Thanks.&lt;/FONT&gt; It works now.&lt;/P&gt;&lt;P&gt;I had set the i = 3 as I only wanted to look at one loop to understand the issue and that was the easiest way to do so. But thanks for mentioning it. These little (potential) mistakes can cost one hours to find ... :)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Feb 2020 08:57:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-dt-lt-lt-select-where-in-for-loop-while-looping-through/m-p/248846#M48852</guid>
      <dc:creator>Ole</dc:creator>
      <dc:date>2020-02-23T08:57:35Z</dc:date>
    </item>
  </channel>
</rss>

