<?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: Recding in JSL while keeping most initial values in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Recding-in-JSL-while-keeping-most-initial-values/m-p/762907#M94330</link>
    <description>&lt;P&gt;Do it interactively in JMP and JMP will create a script for you. For example I have a table&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1717785927445.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65004iFB223B46D006AB25/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1717785927445.png" alt="jthi_0-1717785927445.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And I wish to change 100 to 1&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1717785940218.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65005i8FE82A897B1D797F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1717785940218.png" alt="jthi_1-1717785940218.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_2-1717785946544.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65006iB77A4B0E6D1D190B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_2-1717785946544.png" alt="jthi_2-1717785946544.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;JMP creates a script for you&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_3-1717785965871.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65007iCE9D25CA4D436091/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_3-1717785965871.png" alt="jthi_3-1717785965871.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And you can clean it up and modify it a bit and have it look like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; Recode Column(
	dt:Prob,
	{Map Value(_rcOrig, {100, 1}, Unmatched(_rcNow))},
	Target Column(:Prob) 
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;JMP basically created this script for me without me writing any JSL.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jun 2024 18:48:10 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2024-06-07T18:48:10Z</dc:date>
    <item>
      <title>Recding in JSL while keeping most initial values</title>
      <link>https://community.jmp.com/t5/Discussions/Recding-in-JSL-while-keeping-most-initial-values/m-p/762893#M94323</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a column with probablities. Mostly these are just numbers between 0 and 1. However, for a probablity of 100% I got 100 instead of 1. My idea to fis the issue was simply to ues the recoding function and then replace all occurences of "100" by "1".&lt;/P&gt;&lt;P&gt;The code scnipped I'm using is:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; Recode Column (
	:"probability"n,
	{IF( _rcNOW == 100, 1)},
	Target Column (:"probability"n)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This works partly, the problem is that all cases where the probability is &amp;lt; 100, the updated column is empty. That's because the IF statement does not know what to do in the case. Is there a way to tell that in that case, it should just keep the orignal value?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2024 16:50:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recding-in-JSL-while-keeping-most-initial-values/m-p/762893#M94323</guid>
      <dc:creator>matthias_bruchh</dc:creator>
      <dc:date>2024-06-07T16:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Recding in JSL while keeping most initial values</title>
      <link>https://community.jmp.com/t5/Discussions/Recding-in-JSL-while-keeping-most-initial-values/m-p/762895#M94325</link>
      <description>&lt;P&gt;I think you can use _rcNOW in your else statement&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; Recode Column(
	:"probability"n, 
	{If(_rcNOW == 100, 
		1
	, _rcNOW
	)}, 
	Target Column(:"probability"n)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but if you just want to change 100 to 1, using Map Value (the most basic recode operation) might be easier. I think you can just do this interactively from Recode menu.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2024 16:58:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recding-in-JSL-while-keeping-most-initial-values/m-p/762895#M94325</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-06-07T16:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: Recding in JSL while keeping most initial values</title>
      <link>https://community.jmp.com/t5/Discussions/Recding-in-JSL-while-keeping-most-initial-values/m-p/762896#M94326</link>
      <description>&lt;P&gt;Thanks that worked perfectly! (and looks obvious in hindsight).&lt;BR /&gt;Indeed, I could to it interactively w/o problem and I might have to run that on different files, so I prefer a scirpting solution.&lt;BR /&gt;What do you mean by "Map Value"? (Or is that the interactive aproach?)&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2024 17:37:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recding-in-JSL-while-keeping-most-initial-values/m-p/762896#M94326</guid>
      <dc:creator>matthias_bruchh</dc:creator>
      <dc:date>2024-06-07T17:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Recding in JSL while keeping most initial values</title>
      <link>https://community.jmp.com/t5/Discussions/Recding-in-JSL-while-keeping-most-initial-values/m-p/762907#M94330</link>
      <description>&lt;P&gt;Do it interactively in JMP and JMP will create a script for you. For example I have a table&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1717785927445.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65004iFB223B46D006AB25/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1717785927445.png" alt="jthi_0-1717785927445.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And I wish to change 100 to 1&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1717785940218.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65005i8FE82A897B1D797F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1717785940218.png" alt="jthi_1-1717785940218.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_2-1717785946544.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65006iB77A4B0E6D1D190B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_2-1717785946544.png" alt="jthi_2-1717785946544.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;JMP creates a script for you&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_3-1717785965871.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65007iCE9D25CA4D436091/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_3-1717785965871.png" alt="jthi_3-1717785965871.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And you can clean it up and modify it a bit and have it look like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; Recode Column(
	dt:Prob,
	{Map Value(_rcOrig, {100, 1}, Unmatched(_rcNow))},
	Target Column(:Prob) 
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;JMP basically created this script for me without me writing any JSL.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2024 18:48:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recding-in-JSL-while-keeping-most-initial-values/m-p/762907#M94330</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-06-07T18:48:10Z</dc:date>
    </item>
  </channel>
</rss>

