<?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 Column by index in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Column-by-index/m-p/393788#M64417</link>
    <description>&lt;P&gt;Hi!&amp;nbsp;&lt;BR /&gt;What's the right way to reference a column by index? Ideally I was looking for something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IvanK_1-1623867511998.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33589i80BABFACB8117304/image-size/medium?v=v2&amp;amp;px=400" role="button" title="IvanK_1-1623867511998.png" alt="IvanK_1-1623867511998.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 10 Jun 2023 23:31:58 GMT</pubDate>
    <dc:creator>IvanK</dc:creator>
    <dc:date>2023-06-10T23:31:58Z</dc:date>
    <item>
      <title>Column by index</title>
      <link>https://community.jmp.com/t5/Discussions/Column-by-index/m-p/393788#M64417</link>
      <description>&lt;P&gt;Hi!&amp;nbsp;&lt;BR /&gt;What's the right way to reference a column by index? Ideally I was looking for something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IvanK_1-1623867511998.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33589i80BABFACB8117304/image-size/medium?v=v2&amp;amp;px=400" role="button" title="IvanK_1-1623867511998.png" alt="IvanK_1-1623867511998.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:31:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-by-index/m-p/393788#M64417</guid>
      <dc:creator>IvanK</dc:creator>
      <dc:date>2023-06-10T23:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Column by index</title>
      <link>https://community.jmp.com/t5/Discussions/Column-by-index/m-p/393842#M64421</link>
      <description>&lt;P&gt;You should be able to use just Column(index).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/en/16.0/#page/jmp/send-messages-to-data-column-objects.shtml" target="_self"&gt;Send Messages to Data Column Objects&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;col = Column( 2 );     // assign a reference to the second column&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Jun 2021 19:32:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-by-index/m-p/393842#M64421</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-06-16T19:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: Column by index</title>
      <link>https://community.jmp.com/t5/Discussions/Column-by-index/m-p/393849#M64422</link>
      <description>&lt;P&gt;It may be true for scripts, but in formulas I get this error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IvanK_0-1623872326795.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33590i6F2F63704C855E41/image-size/medium?v=v2&amp;amp;px=400" role="button" title="IvanK_0-1623872326795.png" alt="IvanK_0-1623872326795.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Interestingly, the popup suggests thatthe number can be provided, but it doesn't appear to be the case&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IvanK_1-1623872374721.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33591iFABF4E9C4A46EC47/image-size/medium?v=v2&amp;amp;px=400" role="button" title="IvanK_1-1623872374721.png" alt="IvanK_1-1623872374721.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 19:39:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-by-index/m-p/393849#M64422</guid>
      <dc:creator>IvanK</dc:creator>
      <dc:date>2021-06-16T19:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: Column by index</title>
      <link>https://community.jmp.com/t5/Discussions/Column-by-index/m-p/394020#M64440</link>
      <description>&lt;P&gt;Try with &amp;lt;&amp;lt; get name instead of Column Name()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Choose(:Block, 
	Column(1) &amp;lt;&amp;lt; get name, 
	Column(2) &amp;lt;&amp;lt; get name, 
	Column(3) &amp;lt;&amp;lt; get name
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1623930828018.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33628iA5D47290D1EABBB4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1623930828018.png" alt="jthi_0-1623930828018.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Full example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);


dt = New Table("Untitled",
	Add Rows(3),
	Compress File When Saved(1),
	New Column("Block", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2, 3])),
	New Column("Column 2", Numeric, "Continuous", Format("Best", 12), Set Values([1, ., .])),
	New Column("Column 3", Numeric, "Continuous", Format("Best", 12), Set Values([2, ., .])),
	New Column("Column 4", Numeric, "Continuous", Format("Best", 12), Set Values([3, ., .])),
	New Column("Formula",
		Character,
		"Nominal",
		Formula(Choose(:Block, Column(1) &amp;lt;&amp;lt; get name, Column(2) &amp;lt;&amp;lt; get name, Column(3) &amp;lt;&amp;lt; get name))
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Jun 2021 11:54:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-by-index/m-p/394020#M64440</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-06-17T11:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Column by index</title>
      <link>https://community.jmp.com/t5/Discussions/Column-by-index/m-p/394029#M64442</link>
      <description>&lt;P&gt;Thank you jthi, I feel like "&amp;lt;&amp;lt; get name" gets us one step forward. My final goal is to do a HLOOKUP basically, here's a demonstration. Currently it pulls the column name, while I want it to look at the data of that column.&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IvanK_3-1623931986676.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33629i3D1DD4FC28BB67B6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="IvanK_3-1623931986676.png" alt="IvanK_3-1623931986676.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here's full code if needed:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;New Table( "Untitled",&lt;BR /&gt;Add Rows( 3 ),&lt;BR /&gt;Compress File When Saved( 1 ),&lt;BR /&gt;New Column( "Column 1",&lt;BR /&gt;Numeric,&lt;BR /&gt;"Continuous",&lt;BR /&gt;Format( "Best", 12 ),&lt;BR /&gt;Set Values( [11, 111, 1111] )),&lt;BR /&gt;New Column( "Column 2",&lt;BR /&gt;Numeric,&lt;BR /&gt;"Continuous",&lt;BR /&gt;Format( "Best", 12 ),&lt;BR /&gt;Set Values( [22, 222, 2222] )),&lt;BR /&gt;New Column( "Column 3",&lt;BR /&gt;Numeric,&lt;BR /&gt;"Continuous",&lt;BR /&gt;Format( "Best", 12 ),&lt;BR /&gt;Set Values( [33, 333, 3333] )&lt;BR /&gt;),&lt;BR /&gt;New Column( "Block",&lt;BR /&gt;Numeric,&lt;BR /&gt;"Continuous",&lt;BR /&gt;Format( "Best", 12 ),&lt;BR /&gt;Set Values( [1, 2, 3] )&lt;BR /&gt;),&lt;BR /&gt;New Column( "Formula",&lt;BR /&gt;Character,&lt;BR /&gt;"Nominal",&lt;BR /&gt;Formula(&lt;BR /&gt;Choose( :Block,&lt;BR /&gt;Column( 1 ) &amp;lt;&amp;lt; get name,&lt;BR /&gt;Column( 2 ) &amp;lt;&amp;lt; get name,&lt;BR /&gt;Column( 3 ) &amp;lt;&amp;lt; get name))))&lt;/PRE&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 12:18:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-by-index/m-p/394029#M64442</guid>
      <dc:creator>IvanK</dc:creator>
      <dc:date>2021-06-17T12:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: Column by index</title>
      <link>https://community.jmp.com/t5/Discussions/Column-by-index/m-p/394048#M64445</link>
      <description>&lt;P&gt;Not exactly sure what data you want to get from the columns. Does Block column define the column and row for the cell you want to get the data from?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Column(:Block)[:Block]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1623932861535.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33636i6DD655F1F76275C4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1623932861535.png" alt="jthi_0-1623932861535.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 12:31:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-by-index/m-p/394048#M64445</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-06-17T12:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Column by index</title>
      <link>https://community.jmp.com/t5/Discussions/Column-by-index/m-p/394108#M64447</link>
      <description>&lt;P&gt;Ah... I see what you want now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this as your formula. It uses the format column(dt, n)[row()] to get the value in the current row, of the nth column of a data table, where the value of n is whatever you've placed in the current row of the :block column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Column( :Block &amp;lt;&amp;lt; get data table, :Block )[Row()]&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Brady&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 14:17:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-by-index/m-p/394108#M64447</guid>
      <dc:creator>brady_brady</dc:creator>
      <dc:date>2021-06-17T14:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Column by index</title>
      <link>https://community.jmp.com/t5/Discussions/Column-by-index/m-p/394121#M64449</link>
      <description>&lt;P&gt;Thank you Brady, this is exactly what I was looking for. Much obliged!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 14:41:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-by-index/m-p/394121#M64449</guid>
      <dc:creator>IvanK</dc:creator>
      <dc:date>2021-06-17T14:41:44Z</dc:date>
    </item>
  </channel>
</rss>

