<?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 Trying to access data values from a column one-by-one in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Trying-to-access-data-values-from-a-column-one-by-one/m-p/381674#M63217</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Summarize(dt, IDs = by(:ID)); //this finds all the unique IDs in the data file, which we will need
For (i=0, i&amp;lt;=N Items(IDs), i++,
    ID = donorIDs[i];&lt;BR /&gt;);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the above doesn't work, and throws a&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Subscript problem in access or evaluation of 'IDs[i]' , IDs[/*###*/i]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess this gets down to some of the fundamentals about how JMP is different from languages like Python and Java, where indexing is common, and instead data are handled in a way that is intended for analysis, display, and manipulation rather than access, or something like that? Sorry if I don't make sense, I'm just trying to make sense of this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What data type is IDs at this point in time? A column? Is column a data type? Is this listed in the Scripting Index? I've looked there multiple times by now, maybe I just missed it? As someone with computer experience, it is very convenient to think in data and object types and I don't know how to deal with stuff in JMP that is so ambiguous.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I guess the bottom line is, how do you perform an element-wise operation over a column in general?&lt;/P&gt;</description>
    <pubDate>Sat, 10 Jun 2023 23:29:41 GMT</pubDate>
    <dc:creator>mostarr</dc:creator>
    <dc:date>2023-06-10T23:29:41Z</dc:date>
    <item>
      <title>Trying to access data values from a column one-by-one</title>
      <link>https://community.jmp.com/t5/Discussions/Trying-to-access-data-values-from-a-column-one-by-one/m-p/381674#M63217</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Summarize(dt, IDs = by(:ID)); //this finds all the unique IDs in the data file, which we will need
For (i=0, i&amp;lt;=N Items(IDs), i++,
    ID = donorIDs[i];&lt;BR /&gt;);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the above doesn't work, and throws a&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Subscript problem in access or evaluation of 'IDs[i]' , IDs[/*###*/i]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess this gets down to some of the fundamentals about how JMP is different from languages like Python and Java, where indexing is common, and instead data are handled in a way that is intended for analysis, display, and manipulation rather than access, or something like that? Sorry if I don't make sense, I'm just trying to make sense of this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What data type is IDs at this point in time? A column? Is column a data type? Is this listed in the Scripting Index? I've looked there multiple times by now, maybe I just missed it? As someone with computer experience, it is very convenient to think in data and object types and I don't know how to deal with stuff in JMP that is so ambiguous.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I guess the bottom line is, how do you perform an element-wise operation over a column in general?&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:29:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trying-to-access-data-values-from-a-column-one-by-one/m-p/381674#M63217</guid>
      <dc:creator>mostarr</dc:creator>
      <dc:date>2023-06-10T23:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to access data values from a column one-by-one</title>
      <link>https://community.jmp.com/t5/Discussions/Trying-to-access-data-values-from-a-column-one-by-one/m-p/381680#M63218</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Summarize(dt, IDs = by(:ID));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The Summarize() function returns JMP Lists.&amp;nbsp; Therefore, IDs returns the unique values of the column ID from the data table referenced by the variable dt.&lt;/P&gt;
&lt;P&gt;Proper referencing would be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;IDs[index value]&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Therefore, referencing it in a For Loop would be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For( i = 1, i &amp;lt;= N Items( IDs ), i++,
     variableX = IDs[i];
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I did not use the variable name of ID as you used in your example.&amp;nbsp; While ID would be a fine name, it might be confusing, since you have a column of the same name in the data table referenced by variable dt.&lt;/P&gt;</description>
      <pubDate>Sat, 01 May 2021 20:19:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trying-to-access-data-values-from-a-column-one-by-one/m-p/381680#M63218</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-05-01T20:19:56Z</dc:date>
    </item>
  </channel>
</rss>

