<?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: Checking loop through a table to check if the column is numeric or nominal in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Checking-loop-through-a-table-to-check-if-the-column-is-numeric/m-p/215785#M43096</link>
    <description>&lt;P&gt;Here is a simple script that will convert the columns found to have numeric values&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

colNames = dt &amp;lt;&amp;lt; get column names( string, character );

For( i = 1, i &amp;lt;= N Items( colNames ), i++,
	If( Is Missing( Num( Column( dt, colNames[i] )[1] ) ) == 0,
		Column( dt, colNames[i] ) &amp;lt;&amp;lt; data type( numeric ) &amp;lt;&amp;lt; modeling type( continuous )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It looks like you need to take the time to read through the Scripting Guide&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; Help==&amp;gt;Books==&amp;gt;Scripting Guide&lt;/P&gt;</description>
    <pubDate>Mon, 01 Jul 2019 22:19:54 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2019-07-01T22:19:54Z</dc:date>
    <item>
      <title>Checking loop through a table to check if the column is numeric or nominal</title>
      <link>https://community.jmp.com/t5/Discussions/Checking-loop-through-a-table-to-check-if-the-column-is-numeric/m-p/215764#M43094</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 539px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/18129i71CE9BF41F3E0727/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have the following table that is the result from&amp;nbsp;&lt;U&gt;stacking and splitting&lt;/U&gt; a much larger table. As you can see, X1, 3 and 5 are Numeric and X2, 4 and 6 are Characters. Because this is a results of stacking and splitting, everything is converted to Nominal and Character, is there away to loop through all the columns, check if the value in the 1st row is numeric/continuous and convert the X1, X3 and X5 column back to numeric and continuous?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:13:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Checking-loop-through-a-table-to-check-if-the-column-is-numeric/m-p/215764#M43094</guid>
      <dc:creator>nguyendv0610</dc:creator>
      <dc:date>2023-06-10T23:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Checking loop through a table to check if the column is numeric or nominal</title>
      <link>https://community.jmp.com/t5/Discussions/Checking-loop-through-a-table-to-check-if-the-column-is-numeric/m-p/215785#M43096</link>
      <description>&lt;P&gt;Here is a simple script that will convert the columns found to have numeric values&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

colNames = dt &amp;lt;&amp;lt; get column names( string, character );

For( i = 1, i &amp;lt;= N Items( colNames ), i++,
	If( Is Missing( Num( Column( dt, colNames[i] )[1] ) ) == 0,
		Column( dt, colNames[i] ) &amp;lt;&amp;lt; data type( numeric ) &amp;lt;&amp;lt; modeling type( continuous )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It looks like you need to take the time to read through the Scripting Guide&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; Help==&amp;gt;Books==&amp;gt;Scripting Guide&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 22:19:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Checking-loop-through-a-table-to-check-if-the-column-is-numeric/m-p/215785#M43096</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-07-01T22:19:54Z</dc:date>
    </item>
  </channel>
</rss>

