<?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: selectWhere on column attributes in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/selectWhere-on-column-attributes/m-p/82798#M37300</link>
    <description>&lt;P&gt;As far as I know, there is no existing function that would spare you from iterating through your columns and checking them individually.&amp;nbsp; You could subset the columns you need to look at by getting a list of all numeric columns (e.g. numeric_cols = dt &amp;lt;&amp;lt; Get Column Names(Numeric, Continuous)).&amp;nbsp; Unless you have a ridiculous number of columns, that probably won't make a noticeable difference in reducing compute time to execute that task.&amp;nbsp; Luckily, it's not very hard to do.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Nov 2018 18:47:44 GMT</pubDate>
    <dc:creator>cwillden</dc:creator>
    <dc:date>2018-11-07T18:47:44Z</dc:date>
    <item>
      <title>selectWhere on column attributes</title>
      <link>https://community.jmp.com/t5/Discussions/selectWhere-on-column-attributes/m-p/82795#M37297</link>
      <description>&lt;P&gt;I'm trying to select all columns which have the attribute "Units", and where the "Units" attribute has a value of "kg/hr". Is there some way to do a clean selectWhere, or do I need to iterate through each column to collect them?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:25:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/selectWhere-on-column-attributes/m-p/82795#M37297</guid>
      <dc:creator>DavidLeber</dc:creator>
      <dc:date>2023-06-09T23:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: selectWhere on column attributes</title>
      <link>https://community.jmp.com/t5/Discussions/selectWhere-on-column-attributes/m-p/82798#M37300</link>
      <description>&lt;P&gt;As far as I know, there is no existing function that would spare you from iterating through your columns and checking them individually.&amp;nbsp; You could subset the columns you need to look at by getting a list of all numeric columns (e.g. numeric_cols = dt &amp;lt;&amp;lt; Get Column Names(Numeric, Continuous)).&amp;nbsp; Unless you have a ridiculous number of columns, that probably won't make a noticeable difference in reducing compute time to execute that task.&amp;nbsp; Luckily, it's not very hard to do.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 18:47:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/selectWhere-on-column-attributes/m-p/82798#M37300</guid>
      <dc:creator>cwillden</dc:creator>
      <dc:date>2018-11-07T18:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: selectWhere on column attributes</title>
      <link>https://community.jmp.com/t5/Discussions/selectWhere-on-column-attributes/m-p/82799#M37301</link>
      <description>&lt;P&gt;Selecting columns with specific properties, such as "Units", can be done without JSL from the Cols-&amp;gt;Columns Viewer menu by clicking on the "Find Columns with Properties" button and then selecting the "Units" check box. This will return a table with a 'Yes' or 'No' for the "Units" property. Sorting this table by right-clicking and selecting "Sort by column..." and then selecting "Units" will make it easy to select all columns with a "units" property.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, to select a specific unit, such as "kg/hr", would require iterating through your columns as you guessed. This would only take a few lines of JSL, something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

For( i = 1, i &amp;lt;= N Cols( dt ), i++,
	If( Column( i ) &amp;lt;&amp;lt; Get Property( "Units" ) == "kg/hr",
		Column( i ) &amp;lt;&amp;lt; set selected
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 19:14:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/selectWhere-on-column-attributes/m-p/82799#M37301</guid>
      <dc:creator>jerry_cooper</dc:creator>
      <dc:date>2018-11-07T19:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: selectWhere on column attributes</title>
      <link>https://community.jmp.com/t5/Discussions/selectWhere-on-column-attributes/m-p/725268#M90940</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i create for my columns a&amp;nbsp; property called METADATA with info TEST&lt;/P&gt;&lt;P&gt;when i tried to select this columns the script doesn't show error, but the columns are not selected&lt;/P&gt;&lt;P&gt;can you help me?&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;For( i = 1, i &amp;lt;= N Cols( dt ), i++,&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If( Column( i ) &amp;lt;&amp;lt; Get Property( "METADATA" ) == "TEST",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Column( i ) &amp;lt;&amp;lt; set selected (1),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;thanks in advance&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Gianpaolo&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;);&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 15:16:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/selectWhere-on-column-attributes/m-p/725268#M90940</guid>
      <dc:creator>GianpaoloP</dc:creator>
      <dc:date>2024-02-23T15:16:58Z</dc:date>
    </item>
  </channel>
</rss>

