<?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 Find a column whose name needs a string from another column in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Find-a-column-whose-name-needs-a-string-from-another-column/m-p/799710#M97555</link>
    <description>&lt;P&gt;I am trying to use a value from a column named "Freq " and find another column . I get an error Invalid Row&lt;/P&gt;&lt;P&gt;The column I am looking for is available. The column Freq is numeric. Is that the issue?&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example the value in a row of the column Freq is 200 then I am looking for the value in IDynatTsense__200__65 .&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P class=""&gt;HashFreqval = &lt;SPAN class=""&gt;Column&lt;/SPAN&gt;( &lt;SPAN class=""&gt;"Freq"&lt;/SPAN&gt; );&lt;/P&gt;&lt;P class=""&gt;IDyn = &lt;SPAN class=""&gt;Column&lt;/SPAN&gt;( &lt;SPAN class=""&gt;"IDynatTsense__"&lt;/SPAN&gt;||HashFreqval[]|| &lt;SPAN class=""&gt;"__65"&lt;/SPAN&gt; );&lt;/P&gt;&lt;P class=""&gt;Error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UnivariateTable_0-1726602124845.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68391iC1AD8F02829BDA31/image-size/medium?v=v2&amp;amp;px=400" role="button" title="UnivariateTable_0-1726602124845.png" alt="UnivariateTable_0-1726602124845.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Sep 2024 19:44:11 GMT</pubDate>
    <dc:creator>UnivariateTable</dc:creator>
    <dc:date>2024-09-17T19:44:11Z</dc:date>
    <item>
      <title>Find a column whose name needs a string from another column</title>
      <link>https://community.jmp.com/t5/Discussions/Find-a-column-whose-name-needs-a-string-from-another-column/m-p/799710#M97555</link>
      <description>&lt;P&gt;I am trying to use a value from a column named "Freq " and find another column . I get an error Invalid Row&lt;/P&gt;&lt;P&gt;The column I am looking for is available. The column Freq is numeric. Is that the issue?&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example the value in a row of the column Freq is 200 then I am looking for the value in IDynatTsense__200__65 .&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P class=""&gt;HashFreqval = &lt;SPAN class=""&gt;Column&lt;/SPAN&gt;( &lt;SPAN class=""&gt;"Freq"&lt;/SPAN&gt; );&lt;/P&gt;&lt;P class=""&gt;IDyn = &lt;SPAN class=""&gt;Column&lt;/SPAN&gt;( &lt;SPAN class=""&gt;"IDynatTsense__"&lt;/SPAN&gt;||HashFreqval[]|| &lt;SPAN class=""&gt;"__65"&lt;/SPAN&gt; );&lt;/P&gt;&lt;P class=""&gt;Error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UnivariateTable_0-1726602124845.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68391iC1AD8F02829BDA31/image-size/medium?v=v2&amp;amp;px=400" role="button" title="UnivariateTable_0-1726602124845.png" alt="UnivariateTable_0-1726602124845.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 19:44:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Find-a-column-whose-name-needs-a-string-from-another-column/m-p/799710#M97555</guid>
      <dc:creator>UnivariateTable</dc:creator>
      <dc:date>2024-09-17T19:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Find a column whose name needs a string from another column</title>
      <link>https://community.jmp.com/t5/Discussions/Find-a-column-whose-name-needs-a-string-from-another-column/m-p/799748#M97557</link>
      <description>&lt;P&gt;&lt;FONT face="courier new,courier"&gt;column[]&lt;/FONT&gt; returns the value of the current &lt;FONT face="courier new,courier"&gt;row()&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;The default value of &lt;FONT face="courier new,courier"&gt;row()&lt;/FONT&gt; is 0. To access the value of row 1, just adjust the pointer via &lt;FONT face="courier new,courier"&gt;row()=1&lt;/FONT&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Table( "test",
	Add Rows( 1 ),
	New Column( "Freq",
	Character,
		Set Values( {"200"} )
	),
	New Column( "IDynatTsense__200__65",
		Set Values( [20] )
	)
);


HashFreqval = Column( "Freq" );
row()=1;
IDyn = Column( "IDynatTsense__"||HashFreqval[]|| "__65" );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Sep 2024 21:32:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Find-a-column-whose-name-needs-a-string-from-another-column/m-p/799748#M97557</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-09-17T21:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Find a column whose name needs a string from another column</title>
      <link>https://community.jmp.com/t5/Discussions/Find-a-column-whose-name-needs-a-string-from-another-column/m-p/799802#M97559</link>
      <description>&lt;P&gt;Error is caused by what hogi wrote, column()[] (same as column()[row()]) is looking for a value of current row which by default is 0 in JMP, which is invalid row number (you can read about this from &lt;A href="https://www.jmp.com/support/help/en/18.1/#page/jmp/iterate-on-rows-in-a-table.shtml#ww711399" target="_blank"&gt;Iterate on Rows in a Table (jmp.com)&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How are you utilizing this code? Most likely this isn't the whole code you are using? You are looking value from "Freq" but which row and are you maybe looping them? Are you trying to get a value from&amp;nbsp;&lt;SPAN&gt;IDynatTsense__200__65&amp;nbsp;(which row?) or just the reference?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 04:43:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Find-a-column-whose-name-needs-a-string-from-another-column/m-p/799802#M97559</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-09-18T04:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: Find a column whose name needs a string from another column</title>
      <link>https://community.jmp.com/t5/Discussions/Find-a-column-whose-name-needs-a-string-from-another-column/m-p/800054#M97580</link>
      <description>&lt;P&gt;Maybe my question is not very clear. I am attaching a simple example&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Depending on the value in the column HashFreq, I need to select data from either column Idyn_&lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;200&lt;/STRONG&gt;&lt;/FONT&gt;_65 or Idyn_&lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;400&lt;/STRONG&gt;&lt;/FONT&gt;_65.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once I can get that data , I can use a formula to calculate further.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Names Default To Here( 1 );
dt1 = Open( "TestDataJunk.jmp" );
HashFreqval = Column( "HashFreq" );
IDyn = Column( "IDynatTsense__"||HashFreqval[]|| "__65" );
dt1 &amp;lt;&amp;lt; New Column( "NewVal", Numeric, Continuous, Formula( IDyn[] ));&lt;/PRE&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 20:10:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Find-a-column-whose-name-needs-a-string-from-another-column/m-p/800054#M97580</guid>
      <dc:creator>UnivariateTable</dc:creator>
      <dc:date>2024-09-18T20:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Find a column whose name needs a string from another column</title>
      <link>https://community.jmp.com/t5/Discussions/Find-a-column-whose-name-needs-a-string-from-another-column/m-p/800109#M97587</link>
      <description>&lt;P&gt;If your data is much more complicated and you don't need a formula, I would most likely just use For Each Row&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$DOWNLOADS/TestDataJunk.jmp");

dt &amp;lt;&amp;lt; New Column("NewVal2", Numeric, Continuous);

For Each Row(dt,
	val = Column(dt, "HashFreq")[Row()];
	val_col = Eval Insert("Idyn_^val^_65");
	Column(dt, "NewVal2")[Row()] = Column(dt, val_col)[Row()];
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Sep 2024 04:27:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Find-a-column-whose-name-needs-a-string-from-another-column/m-p/800109#M97587</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-09-19T04:27:02Z</dc:date>
    </item>
  </channel>
</rss>

