<?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 Setting Row Values Under a Given Condition in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Setting-Row-Values-Under-a-Given-Condition/m-p/279898#M54253</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to JSL and attempting to create a script that will change the value of certain rows in a given column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The general issue I am having is that my data is being categorized as from different locations, when in fact those sites are the same. So when I go to graph them, I get more groups than necessary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the snippet of code that I was hoping would accomplish my goal:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;for each row(
	if( As Column( dtSum:Name( "Originating Fab" )) == "D1C",
		As Column( dtSum:Name( "Originating Fab" )) &amp;lt;&amp;lt; Set Values( { "D1D" } );
	);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Where 'dtSum' is my summary table and 'Originating Fab' is the column that depicts what location that row is from.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So in the above code, I want to change the Originating Site values from "D1C" to "D1D", since those are both the same location.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lain&lt;/P&gt;</description>
    <pubDate>Sat, 10 Jun 2023 23:16:20 GMT</pubDate>
    <dc:creator>lgober</dc:creator>
    <dc:date>2023-06-10T23:16:20Z</dc:date>
    <item>
      <title>Setting Row Values Under a Given Condition</title>
      <link>https://community.jmp.com/t5/Discussions/Setting-Row-Values-Under-a-Given-Condition/m-p/279898#M54253</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to JSL and attempting to create a script that will change the value of certain rows in a given column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The general issue I am having is that my data is being categorized as from different locations, when in fact those sites are the same. So when I go to graph them, I get more groups than necessary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the snippet of code that I was hoping would accomplish my goal:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;for each row(
	if( As Column( dtSum:Name( "Originating Fab" )) == "D1C",
		As Column( dtSum:Name( "Originating Fab" )) &amp;lt;&amp;lt; Set Values( { "D1D" } );
	);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Where 'dtSum' is my summary table and 'Originating Fab' is the column that depicts what location that row is from.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So in the above code, I want to change the Originating Site values from "D1C" to "D1D", since those are both the same location.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lain&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:16:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Setting-Row-Values-Under-a-Given-Condition/m-p/279898#M54253</guid>
      <dc:creator>lgober</dc:creator>
      <dc:date>2023-06-10T23:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Row Values Under a Given Condition</title>
      <link>https://community.jmp.com/t5/Discussions/Setting-Row-Values-Under-a-Given-Condition/m-p/279913#M54255</link>
      <description>&lt;P&gt;You may want to explore doing this interactively, and using Recode to make these changes.&amp;nbsp; It can also generate a script to make the changes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if you really need to do this in JSL, I more efficient way of doing this is to use Get Rows Where() and doing the change all at once, without having to loop&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtSum:Name( "Originating Fab" )[ dtSum&amp;lt;&amp;lt;get rows where( dtSum:Name( "Originating Fab" )  == "D1C")] = "D1D";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Also, if you want to continue using the looping format, this is a more concise version of your code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;for each row(
	if( dtSum:Name( "Originating Fab" ) == "D1C",
		dtSum:Name( "Originating Fab" ) ="D1D";
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Jul 2020 19:59:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Setting-Row-Values-Under-a-Given-Condition/m-p/279913#M54255</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-07-17T19:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Row Values Under a Given Condition</title>
      <link>https://community.jmp.com/t5/Discussions/Setting-Row-Values-Under-a-Given-Condition/m-p/279918#M54257</link>
      <description>&lt;P&gt;Hey Jim,&lt;BR /&gt;&lt;BR /&gt;Thanks for the quick reply, I had not heard of the get Rows Where() function before.&lt;BR /&gt;&lt;BR /&gt;However neither of those solutions seem to do me any good.&lt;BR /&gt;&lt;BR /&gt;I knew that JMP could generate scripts interactively, but I am not familiar enough with how to do that in this context. (I've mostly used that for graphs.)&lt;BR /&gt;&lt;BR /&gt;Any help with the interactive route?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 20:18:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Setting-Row-Values-Under-a-Given-Condition/m-p/279918#M54257</guid>
      <dc:creator>lgober</dc:creator>
      <dc:date>2020-07-17T20:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Row Values Under a Given Condition</title>
      <link>https://community.jmp.com/t5/Discussions/Setting-Row-Values-Under-a-Given-Condition/m-p/279919#M54258</link>
      <description>&lt;P&gt;Right click on the column of interest and select Recode.&amp;nbsp; You will be able to select existing values in your column and specify what to change them to.&amp;nbsp; This is the interactive method that I was talking about.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 20:33:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Setting-Row-Values-Under-a-Given-Condition/m-p/279919#M54258</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-07-17T20:33:19Z</dc:date>
    </item>
  </channel>
</rss>

