<?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: How do I use JSL to change the value in cells with  missing values to zero? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-use-JSL-to-change-the-value-in-cells-with-missing/m-p/51737#M29344</link>
    <description>&lt;P&gt;Here is the same idea as&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/8582"&gt;@cwillden&lt;/a&gt;&amp;nbsp;but without having to use Eval(Parse())&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

numericColumnNames = dt &amp;lt;&amp;lt; get column names( numeric, string );

For( i = 1, i &amp;lt;= N Items( numericColumnNames ), i++,
	Try(
		Column( dt, numericColumnNames[i] )[dt &amp;lt;&amp;lt; get rows where(
			Is Missing( (As Column( dt, numericColumnNames[i] )) )
		)] = 0
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 21 Feb 2018 16:09:41 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2018-02-21T16:09:41Z</dc:date>
    <item>
      <title>How do I use JSL to change the value in cells with  missing values to zero?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-JSL-to-change-the-value-in-cells-with-missing/m-p/51732#M29340</link>
      <description>&lt;P&gt;When splitting a table, I end up with cells in multiple columns with missing values.&amp;nbsp; I want to change these values to 0.&amp;nbsp; The number of rows and split columns will vary, based upon data being pulled in through an SQL query.&amp;nbsp; How do I iterate through these selected columns and make this change from missing value to 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 15:31:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-JSL-to-change-the-value-in-cells-with-missing/m-p/51732#M29340</guid>
      <dc:creator>lou</dc:creator>
      <dc:date>2018-02-21T15:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use JSL to change the value in cells with  missing values to zero?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-JSL-to-change-the-value-in-cells-with-missing/m-p/51736#M29343</link>
      <description>&lt;P&gt;Try something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
cols = dt &amp;lt;&amp;lt; Get Selected Columns();

For( i = 1, i &amp;lt;= N Items( cols ), i++,
	Eval( Parse( Eval Insert( "^cols[i]^[dt &amp;lt;&amp;lt; Get Rows Where(Is Missing(^cols[i]^))] = 0" ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I ended up using the Eval-Parse-Eval Insert because the Is Missing function was not liking something like Is Missing(cols[i]) or Is Missing(Column(cols[i])).&amp;nbsp; Using the Eval-Parse-Eval Insert always feels a bit like a hack, but it will get you what you need.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 16:03:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-JSL-to-change-the-value-in-cells-with-missing/m-p/51736#M29343</guid>
      <dc:creator>cwillden</dc:creator>
      <dc:date>2018-02-21T16:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use JSL to change the value in cells with  missing values to zero?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-JSL-to-change-the-value-in-cells-with-missing/m-p/51737#M29344</link>
      <description>&lt;P&gt;Here is the same idea as&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/8582"&gt;@cwillden&lt;/a&gt;&amp;nbsp;but without having to use Eval(Parse())&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

numericColumnNames = dt &amp;lt;&amp;lt; get column names( numeric, string );

For( i = 1, i &amp;lt;= N Items( numericColumnNames ), i++,
	Try(
		Column( dt, numericColumnNames[i] )[dt &amp;lt;&amp;lt; get rows where(
			Is Missing( (As Column( dt, numericColumnNames[i] )) )
		)] = 0
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Feb 2018 16:09:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-JSL-to-change-the-value-in-cells-with-missing/m-p/51737#M29344</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-02-21T16:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use JSL to change the value in cells with  missing values to zero?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-JSL-to-change-the-value-in-cells-with-missing/m-p/51738#M29345</link>
      <description>&lt;P&gt;You can do it&amp;nbsp;in three steps&amp;nbsp;by hand:&lt;/P&gt;&lt;P&gt;Select&amp;nbsp;the columns&lt;/P&gt;&lt;P&gt;Choose standardize attributes and then recode.&lt;/P&gt;&lt;P&gt;Recode all .'s to 0.&lt;/P&gt;&lt;P&gt;If you want to do it by jsl, you could do it like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt=current data table();
colnames = dt &amp;lt;&amp;lt; get column names( numeric,string );
For( i = 1, i &amp;lt;= N Items( colnames ), i++,
	column(dt,colnames[i])[dt&amp;lt;&amp;lt;get rows where(is missing(as column(dt,colnames[i])))]=0;
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Kind regards, Thomas&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 16:15:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-JSL-to-change-the-value-in-cells-with-missing/m-p/51738#M29345</guid>
      <dc:creator>thomasz</dc:creator>
      <dc:date>2018-02-21T16:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use JSL to change the value in cells with  missing values to zero?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-JSL-to-change-the-value-in-cells-with-missing/m-p/51748#M29350</link>
      <description>&lt;P&gt;Thanks, thomasz.&amp;nbsp; Works great!!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 17:59:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-JSL-to-change-the-value-in-cells-with-missing/m-p/51748#M29350</guid>
      <dc:creator>lou</dc:creator>
      <dc:date>2018-02-21T17:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use JSL to change the value in cells with  missing values to zero?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-JSL-to-change-the-value-in-cells-with-missing/m-p/51755#M29353</link>
      <description>&lt;P&gt;Agreed that in this instance it's not necessary but it's a tremendously useful pattern.&amp;nbsp; Take an arbitrarily complex piece of JSL.&amp;nbsp; Particularly one where it's difficult to parameterise the constituent components.&amp;nbsp; Bracket your variables with carets (^var^) and&amp;nbsp;paste&amp;nbsp;the whole lot&amp;nbsp;inside an "&lt;SPAN&gt;Eval-Parse-Eval Insert" pattern.&amp;nbsp; Problem solved.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 18:16:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-JSL-to-change-the-value-in-cells-with-missing/m-p/51755#M29353</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2018-02-21T18:16:00Z</dc:date>
    </item>
  </channel>
</rss>

