<?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: use of &amp;quot;for each row&amp;quot; with column name from a list in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/use-of-quot-for-each-row-quot-with-column-name-from-a-list/m-p/6467#M6463</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you, the second approach worked. (I prefer that because I use the same list for something else)&lt;/P&gt;&lt;P&gt;I tried the column() way before posting, but it didn't worked without the []&lt;/P&gt;&lt;P&gt;I also looked through the debugger, and it was correctly traced as a column reference instead of a string, and still I don't understand why it needs the []. if you use a hardwired version, let's say&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for each row (:update_01 = trim (:update_01));&lt;/P&gt;&lt;P&gt;it works without the [], and it seems to me that there is no references on that in the help or in the books ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;anyway, now it works. thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Mar 2013 14:38:18 GMT</pubDate>
    <dc:creator>dghidoni</dc:creator>
    <dc:date>2013-03-28T14:38:18Z</dc:date>
    <item>
      <title>use of "for each row" with column name from a list</title>
      <link>https://community.jmp.com/t5/Discussions/use-of-quot-for-each-row-quot-with-column-name-from-a-list/m-p/6465#M6461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;I am working on a way to clean a user-generated table and I'm incurring in an issue: the code compile correctly, but it doesn't work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table with unknown columns (read: multiple, variable, hand-written by user) both in numbers and names.&lt;/P&gt;&lt;P&gt;I would like to perform a simple standardization, let's say polish the values from unwanted spaces and uppercase errors.&lt;/P&gt;&lt;P&gt;so I generate a list with column names, put up a cycle and place a for each row inside.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It compile, but doesn't work. any suggestion? the code is here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;user_page = open ("\user\page.csv", labels(1));&lt;/P&gt;&lt;P&gt;full_list = user_page &amp;lt;&amp;lt;Get Column Names(string);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for (i=1,i&amp;lt;Nitems(full_list)+1,i++,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sclmn = ":"||full_list&lt;I&gt;;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for each row (sclmn = trim (sclmn));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for each row (sclmn = lowercase (sclmn));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried several variations, using a column reference instead of a string, or using Eval(), but all failed to compile. This layout is the only one compiling, but still doesn't work. Can someone help me to understand why?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 13:33:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/use-of-quot-for-each-row-quot-with-column-name-from-a-list/m-p/6465#M6461</guid>
      <dc:creator>dghidoni</dc:creator>
      <dc:date>2013-03-28T13:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: use of "for each row" with column name from a list</title>
      <link>https://community.jmp.com/t5/Discussions/use-of-quot-for-each-row-quot-with-column-name-from-a-list/m-p/6466#M6462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The trick is to make JMP recognize sclmn as a column. In the current script sclmn is just a string. Also, ForEachRow() often requires an empty index [ ] after column variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are two ways to do it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From list of column names:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;full_list &lt;SPAN style="color: #160091;"&gt;=&lt;/SPAN&gt; user_page &lt;SPAN style="color: #160091;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; Get Column Names&lt;STRONG&gt;()&lt;/STRONG&gt;&lt;SPAN style="color: #160091;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #2800e1;"&gt;For&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; i &lt;SPAN style="color: #160091;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #509092;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #160091;"&gt;,&lt;/SPAN&gt; i &lt;SPAN style="color: #160091;"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN style="color: #2800e1;"&gt;N Items&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; full_list &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #160091;"&gt;,&lt;/SPAN&gt; i&lt;SPAN style="color: #160091;"&gt;++,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; sclmn &lt;SPAN style="color: #160091;"&gt;=&lt;/SPAN&gt; full_list&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;SPAN style="color: #160091;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &lt;SPAN style="color: #2800e1;"&gt;For Each Row&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; sclmn&lt;STRONG&gt;[]&lt;/STRONG&gt; &lt;SPAN style="color: #160091;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #2800e1;"&gt;Trim&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; sclmn&lt;STRONG&gt;[]&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #160091;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &lt;SPAN style="color: #2800e1;"&gt;For Each Row&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; sclmn&lt;STRONG&gt;[]&lt;/STRONG&gt; &lt;SPAN style="color: #160091;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #2800e1;"&gt;Lowercase&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; sclmn&lt;STRONG&gt;[]&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #160091;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #160091;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or from list of column names as strings:&lt;/P&gt;&lt;P style="margin: 0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;full_list &lt;SPAN style="color: #160091;"&gt;=&lt;/SPAN&gt; user_page &lt;SPAN style="color: #160091;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; Get Column Names&lt;STRONG&gt;(&lt;/STRONG&gt; string &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #160091;"&gt;;&lt;/SPAN&gt; &lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #2800e1;"&gt;For&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; i &lt;SPAN style="color: #160091;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #509092;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #160091;"&gt;,&lt;/SPAN&gt; i &lt;SPAN style="color: #160091;"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN style="color: #2800e1;"&gt;N Items&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; full_list &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #160091;"&gt;,&lt;/SPAN&gt; i&lt;SPAN style="color: #160091;"&gt;++,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; sclmn &lt;SPAN style="color: #160091;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #2800e1;"&gt;Column&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; full_list&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;]&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #160091;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &lt;SPAN style="color: #2800e1;"&gt;For Each Row&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; sclmn&lt;STRONG&gt;[]&lt;/STRONG&gt; &lt;SPAN style="color: #160091;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #2800e1;"&gt;Trim&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; sclmn&lt;STRONG&gt;[]&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #160091;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &lt;SPAN style="color: #2800e1;"&gt;For Each Row&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; sclmn&lt;STRONG&gt;[]&lt;/STRONG&gt; &lt;SPAN style="color: #160091;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #2800e1;"&gt;Lowercase&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; sclmn&lt;STRONG&gt;[]&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #160091;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #160091;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 14:10:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/use-of-quot-for-each-row-quot-with-column-name-from-a-list/m-p/6466#M6462</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2013-03-28T14:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: use of "for each row" with column name from a list</title>
      <link>https://community.jmp.com/t5/Discussions/use-of-quot-for-each-row-quot-with-column-name-from-a-list/m-p/6467#M6463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you, the second approach worked. (I prefer that because I use the same list for something else)&lt;/P&gt;&lt;P&gt;I tried the column() way before posting, but it didn't worked without the []&lt;/P&gt;&lt;P&gt;I also looked through the debugger, and it was correctly traced as a column reference instead of a string, and still I don't understand why it needs the []. if you use a hardwired version, let's say&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for each row (:update_01 = trim (:update_01));&lt;/P&gt;&lt;P&gt;it works without the [], and it seems to me that there is no references on that in the help or in the books ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;anyway, now it works. thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 14:38:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/use-of-quot-for-each-row-quot-with-column-name-from-a-list/m-p/6467#M6463</guid>
      <dc:creator>dghidoni</dc:creator>
      <dc:date>2013-03-28T14:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: use of "for each row" with column name from a list</title>
      <link>https://community.jmp.com/t5/Discussions/use-of-quot-for-each-row-quot-with-column-name-from-a-list/m-p/6468#M6464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;According to the JMP Scripting Guide: "Always use a subscript on a column reference to access the values in the cells of columns." This seems to be the best practice although there are exceptions where it works without the square brackets as you point out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Apr 2013 17:23:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/use-of-quot-for-each-row-quot-with-column-name-from-a-list/m-p/6468#M6464</guid>
      <dc:creator>jeff3928</dc:creator>
      <dc:date>2013-04-19T17:23:28Z</dc:date>
    </item>
  </channel>
</rss>

