<?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: How to get entire row values using JSL? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-get-entire-row-values-using-JSL/m-p/56227#M31562</link>
    <description>&lt;P&gt;Subscripting data tables is very handy but is it possible to use the "by" function in this (for example&amp;nbsp;by( :age )) to pull all the names of people who have the same age into the column?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an example:&lt;/P&gt;&lt;P&gt;I'd like to take all the names where the age is the same and concatenate them in a column.&lt;/P&gt;&lt;P&gt;One of the common next steps is then summarizing other columns by those concatenated names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2018-05-02_3-59-31.png" style="width: 752px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/10599i6CF1C5D84394262B/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-05-02_3-59-31.png" alt="2018-05-02_3-59-31.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2018-05-02_4-01-21.png" style="width: 769px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/10600iA95B1C6538B8642E/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-05-02_4-01-21.png" alt="2018-05-02_4-01-21.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've dug through and tried multiple approaches and I think I'm just missing something simple, but what I'm hoping is that there is a very straightforward way to do this using either subscription or something like&lt;BR /&gt;dt:name &amp;lt;&amp;lt; get values(by(age)) and then either put that in a column or use it in a script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this as a formula column:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt[Index( :first_row, :last_row ), {:name}]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And each subexpression provided the correct result to match your example&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// fetch a list if character columns are involved.&amp;nbsp;
// notice the matrix is reversing the order
dt[&amp;nbsp;4::2,&amp;nbsp;"name"];&amp;nbsp;// {"JACLYN", "JANE", "LOUISE"}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;but I'm not able to get the actual list of names&amp;nbsp;{"JACLYN", "JANE", "LOUISE"} to return in the column.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for any help,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Aron&lt;/P&gt;</description>
    <pubDate>Wed, 02 May 2018 11:24:29 GMT</pubDate>
    <dc:creator>aronwilson</dc:creator>
    <dc:date>2018-05-02T11:24:29Z</dc:date>
    <item>
      <title>How to get entire row values using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-entire-row-values-using-JSL/m-p/40408#M23674</link>
      <description>&lt;P&gt;HI All,&lt;/P&gt;&lt;P&gt;how we can get intire row values using jsl for a given row?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:24:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-entire-row-values-using-JSL/m-p/40408#M23674</guid>
      <dc:creator>ram</dc:creator>
      <dc:date>2023-06-09T23:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to get entire row values using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-entire-row-values-using-JSL/m-p/40419#M23683</link>
      <description>&lt;P&gt;If you only have numeric columns, you could exploit 'GetAsMatrix'. If you have character and numeric columns, you could use 'GetAllColumnsAsMatrix', but then you still have to handle the coded character values. So, in the latter case, it might be simpler to just define a function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

getRow =
Function({tbl, rn}, {DefaultLocal},
	rowContents = {};
	for(c=1, c&amp;lt;=NCols(dt), c++,
		InsertInto(rowContents, Column(tbl, c)[rn]);
	);
	rowContents;
);

Print(getRow(dt, 5));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 18:44:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-entire-row-values-using-JSL/m-p/40419#M23683</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2017-06-14T18:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to get entire row values using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-entire-row-values-using-JSL/m-p/40424#M23685</link>
      <description>&lt;P&gt;In JMP 13 you can use &lt;A href="https://community.jmp.com/t5/Uncharted/Data-table-subscripting/ba-p/21013" target="_blank"&gt;data table subscripting&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$sample_data/big class.jmp" );
row5 = dt[5, 0];
Show( row5 );&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;row5 = {"LILLIE", 12, "F", 52, 64};&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 20:30:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-entire-row-values-using-JSL/m-p/40424#M23685</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-06-14T20:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to get entire row values using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-entire-row-values-using-JSL/m-p/40436#M23694</link>
      <description>&lt;P&gt;Nice!&lt;/P&gt;
&lt;P&gt;Note how data table subscripting gives either a list or matrix, as needed:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt &amp;lt;&amp;lt; colorByColumn(:sex);
r4Vals = dt[4,0];
Print(r4Vals);
dt &amp;lt;&amp;lt; deleteColumns({:name, :sex});
r4Vals = dt[4,0];
Print(r4Vals);
rsc = dt &amp;lt;&amp;lt; NewColumn("Row States", Row State);
rsc &amp;lt;&amp;lt; copyFromRowStates;
r4Vals = dt[4,0];
Print(r4Vals);
dt &amp;lt;&amp;lt; NewColumn("Expression", Expression);
r4Vals = dt[4,0];
Print(r4Vals);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Jun 2017 14:37:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-entire-row-values-using-JSL/m-p/40436#M23694</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2017-06-15T14:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to get entire row values using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-entire-row-values-using-JSL/m-p/56227#M31562</link>
      <description>&lt;P&gt;Subscripting data tables is very handy but is it possible to use the "by" function in this (for example&amp;nbsp;by( :age )) to pull all the names of people who have the same age into the column?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an example:&lt;/P&gt;&lt;P&gt;I'd like to take all the names where the age is the same and concatenate them in a column.&lt;/P&gt;&lt;P&gt;One of the common next steps is then summarizing other columns by those concatenated names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2018-05-02_3-59-31.png" style="width: 752px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/10599i6CF1C5D84394262B/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-05-02_3-59-31.png" alt="2018-05-02_3-59-31.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2018-05-02_4-01-21.png" style="width: 769px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/10600iA95B1C6538B8642E/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-05-02_4-01-21.png" alt="2018-05-02_4-01-21.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've dug through and tried multiple approaches and I think I'm just missing something simple, but what I'm hoping is that there is a very straightforward way to do this using either subscription or something like&lt;BR /&gt;dt:name &amp;lt;&amp;lt; get values(by(age)) and then either put that in a column or use it in a script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this as a formula column:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt[Index( :first_row, :last_row ), {:name}]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And each subexpression provided the correct result to match your example&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// fetch a list if character columns are involved.&amp;nbsp;
// notice the matrix is reversing the order
dt[&amp;nbsp;4::2,&amp;nbsp;"name"];&amp;nbsp;// {"JACLYN", "JANE", "LOUISE"}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;but I'm not able to get the actual list of names&amp;nbsp;{"JACLYN", "JANE", "LOUISE"} to return in the column.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for any help,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Aron&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 11:24:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-entire-row-values-using-JSL/m-p/56227#M31562</guid>
      <dc:creator>aronwilson</dc:creator>
      <dc:date>2018-05-02T11:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to get entire row values using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-entire-row-values-using-JSL/m-p/56229#M31564</link>
      <description>&lt;P&gt;Apparently, all I needed to do was post and I instantly found an answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;fr = Col Minimum( Row(), :age );
lr = Col Maximum( Row(), :age );
dt:name[Index( fr, lr )];
//returns {"KATIE", "LOUISE", "JANE", "JACLYN", "LILLIE", "TIM", "JAMES", "ROBERT"}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is exactly what I was looking for.&lt;/P&gt;&lt;P&gt;Using the col min and max with row is pretty simple, so that works.&lt;/P&gt;&lt;P&gt;However, I am curious if it's possible to use a by(age) argument in the subscript directly, I've used it in Make Validation Column and it makes it so much easier to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Aron&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 11:33:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-entire-row-values-using-JSL/m-p/56229#M31564</guid>
      <dc:creator>aronwilson</dc:creator>
      <dc:date>2018-05-02T11:33:01Z</dc:date>
    </item>
  </channel>
</rss>

