<?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: Change Values in a Column to UpperCase in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Change-Values-in-a-Column-to-UpperCase/m-p/212257#M42486</link>
    <description>&lt;P&gt;The For Each Row() function will automatically loop through all rows in the data table, so the below is another way of handling your question&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For Each Row( As Column( dt, "keyword" ) = Lowercase( As Column( dt, "keyword" ) ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Be a little cautious with the function, in that you can not have a For Each Row() function within another For Each Row() function&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jun 2019 00:16:11 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2019-06-07T00:16:11Z</dc:date>
    <item>
      <title>Change Values in a Column to UpperCase</title>
      <link>https://community.jmp.com/t5/Discussions/Change-Values-in-a-Column-to-UpperCase/m-p/212244#M42482</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question: I have a data table with data values in upper and lower case text strings in one column.&lt;/P&gt;&lt;P&gt;I expect that the code will need to loop through each row, select the column of interest and set the value in the column to uppercase. I am having an issue figuring out the correct syntax to do this. This is what I have so far, but don't think I am close enough. Thanks to any help that can be provided.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000dd" face="Consolas" size="2"&gt;&amp;nbsp; For&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;( k = &lt;/FONT&gt;&lt;FONT color="#008080" face="Consolas" size="2"&gt;1&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;, k &amp;lt;= &lt;/FONT&gt;&lt;FONT color="#0000dd" face="Consolas" size="2"&gt;N Rows&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;( dt3 ), k++, &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000dd" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Column&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;( dt, :KEYWORD)[k] = &lt;/FONT&gt;&lt;FONT color="#0000dd" face="Consolas" size="2"&gt;UpperCase&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;( &lt;/FONT&gt;&lt;FONT color="#0000dd" face="Consolas" size="2"&gt;Column&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;( dt, :KEYWORD)[k]) );&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 23:38:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Change-Values-in-a-Column-to-UpperCase/m-p/212244#M42482</guid>
      <dc:creator>JensRiege</dc:creator>
      <dc:date>2019-06-06T23:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Change Values in a Column to UpperCase</title>
      <link>https://community.jmp.com/t5/Discussions/Change-Values-in-a-Column-to-UpperCase/m-p/212255#M42484</link>
      <description>&lt;P&gt;So you are foring through the number rows in dt3 but affecting dt seems like an issue first off.&amp;nbsp; Plus the syntax is either :Keyword[k] or Column(dt, "Keyword")[k] or dt:Keyword[k].&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a corrected one&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );
dt = new table("Test", 
	New Column("Keyword", character, &amp;lt;&amp;lt;Set Values({"abC", "Def", "ABC", "abcdfe"}))
);

For( k = 1, k &amp;lt;= N Rows( dt/*dt3*/ ), k++,
	//Column( dt, :KEYWORD)[k] = UpperCase( Column( dt, :KEYWORD)[k]) 
	Column(dt, "Keyword")[k] = UPPERCASE(Column(dt, "KEYWORD")[k]);
	
	//or
	//:Keyword[k] = Uppercase(:Keyword[k]);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But it'd likely be faster to just do all of them at once and set values.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;values = Column(dt, "Keyword") &amp;lt;&amp;lt; Get Values();
u_values = parse(uppercase(char(values)));
Column(dt, "Keyword") &amp;lt;&amp;lt; Set values(u_values);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 23:56:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Change-Values-in-a-Column-to-UpperCase/m-p/212255#M42484</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2019-06-06T23:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Change Values in a Column to UpperCase</title>
      <link>https://community.jmp.com/t5/Discussions/Change-Values-in-a-Column-to-UpperCase/m-p/212257#M42486</link>
      <description>&lt;P&gt;The For Each Row() function will automatically loop through all rows in the data table, so the below is another way of handling your question&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For Each Row( As Column( dt, "keyword" ) = Lowercase( As Column( dt, "keyword" ) ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Be a little cautious with the function, in that you can not have a For Each Row() function within another For Each Row() function&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 00:16:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Change-Values-in-a-Column-to-UpperCase/m-p/212257#M42486</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-06-07T00:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Change Values in a Column to UpperCase</title>
      <link>https://community.jmp.com/t5/Discussions/Change-Values-in-a-Column-to-UpperCase/m-p/212317#M42504</link>
      <description>&lt;P&gt;Not sure if a script is necessary. Select the column with the character data, select Cols &amp;gt; Recode. Changing case is a built-in operation.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 13:19:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Change-Values-in-a-Column-to-UpperCase/m-p/212317#M42504</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-06-07T13:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: Change Values in a Column to UpperCase</title>
      <link>https://community.jmp.com/t5/Discussions/Change-Values-in-a-Column-to-UpperCase/m-p/212344#M42513</link>
      <description>Thank you Mark,&lt;BR /&gt;I am trying to create an automated process, which I why I was trying the script approach.&lt;BR /&gt;Appreciate the feedback,&lt;BR /&gt;Jens</description>
      <pubDate>Fri, 07 Jun 2019 16:50:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Change-Values-in-a-Column-to-UpperCase/m-p/212344#M42513</guid>
      <dc:creator>JensRiege</dc:creator>
      <dc:date>2019-06-07T16:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: Change Values in a Column to UpperCase</title>
      <link>https://community.jmp.com/t5/Discussions/Change-Values-in-a-Column-to-UpperCase/m-p/212346#M42514</link>
      <description>&lt;P&gt;Thank you for the quick solutions. It's nice to see two ways of doing this. Looks like I was close on the first one. Tested both and they work and will use the second one since it is faster.&lt;/P&gt;&lt;P&gt;Appreciate the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 17:06:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Change-Values-in-a-Column-to-UpperCase/m-p/212346#M42514</guid>
      <dc:creator>JensRiege</dc:creator>
      <dc:date>2019-06-07T17:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Change Values in a Column to UpperCase</title>
      <link>https://community.jmp.com/t5/Discussions/Change-Values-in-a-Column-to-UpperCase/m-p/212349#M42515</link>
      <description>Thank you for providing one more way to do this... It's useful when trying to understand the syntax. Since this one could have a conflict if another For Each Row() function is used, I will try the second solution provided above.&lt;BR /&gt;Thank you for providing an example with the 'For Each Row ()' function to do this.</description>
      <pubDate>Fri, 07 Jun 2019 17:11:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Change-Values-in-a-Column-to-UpperCase/m-p/212349#M42515</guid>
      <dc:creator>JensRiege</dc:creator>
      <dc:date>2019-06-07T17:11:17Z</dc:date>
    </item>
  </channel>
</rss>

