<?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 non-empty row values corresponding to chosen labels from columns? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-get-non-empty-row-values-corresponding-to-chosen-labels/m-p/718420#M90116</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2581"&gt;@miguello&lt;/a&gt;, is there a question?&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jan 2024 18:21:15 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2024-01-25T18:21:15Z</dc:date>
    <item>
      <title>How to get non-empty row values corresponding to chosen labels from columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-non-empty-row-values-corresponding-to-chosen-labels/m-p/700939#M88539</link>
      <description>&lt;P&gt;I have incoming data of the form as attached.&lt;/P&gt;&lt;P&gt;I want to get the first first three row values from each column (encircled red) which appear against specific labels (encircled blue).&lt;/P&gt;&lt;P&gt;The following works for Current but not for Voltage (for Voltage I get empty values which I understand why)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Stage = "7";  resCol = "Current"; 
theLSL = Column( dt, resCol )[(dt &amp;lt;&amp;lt; get rows where( :TestStage == Stage &amp;amp; :label == "LSL" ))[1]];  show (theLSL);
theUSL = Column( dt, resCol )[(dt &amp;lt;&amp;lt; get rows where( :TestStage == Stage &amp;amp; :label == "USL" ))[1]];  show (theUSL);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Neo_0-1700496678454.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58928i6BE3DCF25F636228/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Neo_0-1700496678454.png" alt="Neo_0-1700496678454.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;There are other columns in my data table populated similarly for other test test stages/labels.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 16:20:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-non-empty-row-values-corresponding-to-chosen-labels/m-p/700939#M88539</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-11-20T16:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to get non-empty row values corresponding to chosen labels from columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-non-empty-row-values-corresponding-to-chosen-labels/m-p/700953#M88541</link>
      <description>&lt;P&gt;You could add additional check using IsMissing()&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;... &amp;amp; !IsMissing(Column(dt, resCol)[])&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 16:30:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-non-empty-row-values-corresponding-to-chosen-labels/m-p/700953#M88541</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-20T16:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to get non-empty row values corresponding to chosen labels from columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-non-empty-row-values-corresponding-to-chosen-labels/m-p/700977#M88545</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 16:42:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-non-empty-row-values-corresponding-to-chosen-labels/m-p/700977#M88545</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-11-20T16:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get non-empty row values corresponding to chosen labels from columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-non-empty-row-values-corresponding-to-chosen-labels/m-p/700984#M88548</link>
      <description>&lt;P&gt;It is one more search condition to your &amp;lt;&amp;lt; get rows where&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; get rows where(:TestStage == Stage &amp;amp; :label == "USL" &amp;amp; !Is Missing(Column(dt, resCol)[]))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Nov 2023 16:42:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-non-empty-row-values-corresponding-to-chosen-labels/m-p/700984#M88548</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-20T16:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get non-empty row values corresponding to chosen labels from columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-non-empty-row-values-corresponding-to-chosen-labels/m-p/701009#M88551</link>
      <description>&lt;P&gt;The JSL as written only returns the first matching row's value.&amp;nbsp; While&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; get rows where( :TestStage == Stage &amp;amp; :label == "LSL" )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;returns a matrix of all of the matching rows found,&amp;nbsp; When the subscript&amp;nbsp; of [1] is added&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;(dt &amp;lt;&amp;lt; get rows where( :TestStage == Stage &amp;amp; :label == "LSL" ))[1]&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;it returns the row number of just the first row found, which in your example, returns a missing value.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;Jarmo, suggests adding a further clarification to eliminate missing values, which would change your Get Rows Where() to&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;(dt &amp;lt;&amp;lt; get rows where( :TestStage == Stage &amp;amp; :label == "LSL" &amp;amp; !IsMissing(Column(dt, resCol) ) )[1]&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is a fine solution, if you are just looking for the first non missing value.&amp;nbsp; However, if your data may contain multiple rows of non missing LSL values, then you may not want the first non missing value found.&amp;nbsp; You may want to do something like find the Max USL value, or the Mean USL value from all of the non missing rows returned.&amp;nbsp; You could do something like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;theUSL = dt &amp;lt;&amp;lt; get rows where( :TestStage == Stage &amp;amp; :label == "LSL" &amp;amp; !Is Missing( Column( dt, resCol ) ) );
USLMat = [];
For Each( {foundRow, index}, theUSL, USLMat = USLMat || Column( dt, resCol )[index] );
theUSL = Mean( USLMat );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 17:39:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-non-empty-row-values-corresponding-to-chosen-labels/m-p/701009#M88551</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-11-20T17:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to get non-empty row values corresponding to chosen labels from columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-non-empty-row-values-corresponding-to-chosen-labels/m-p/718419#M90115</link>
      <description>&lt;P&gt;I'm trying to do the same thing and in my case&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; Get Rows Where(:A == "AAA")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;gives a list with one element.&lt;/P&gt;&lt;P&gt;So I have to use&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;:B[(dt &amp;lt;&amp;lt; Get Rows Where(:A == "AAA"))[1]]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 18:09:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-non-empty-row-values-corresponding-to-chosen-labels/m-p/718419#M90115</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2024-01-25T18:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to get non-empty row values corresponding to chosen labels from columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-non-empty-row-values-corresponding-to-chosen-labels/m-p/718420#M90116</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2581"&gt;@miguello&lt;/a&gt;, is there a question?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 18:21:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-non-empty-row-values-corresponding-to-chosen-labels/m-p/718420#M90116</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-01-25T18:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to get non-empty row values corresponding to chosen labels from columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-non-empty-row-values-corresponding-to-chosen-labels/m-p/718439#M90121</link>
      <description>&lt;P&gt;I guess not. Just would like to understand which behavior is correct and why me and&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/28235"&gt;@Neo&lt;/a&gt;&amp;nbsp;have it one way, and you have it another?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What does it depend on whether it gives matrix or single element list with matrix?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 20:53:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-non-empty-row-values-corresponding-to-chosen-labels/m-p/718439#M90121</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2024-01-25T20:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get non-empty row values corresponding to chosen labels from columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-non-empty-row-values-corresponding-to-chosen-labels/m-p/718444#M90122</link>
      <description>&lt;P&gt;If you are returning only 1 row from the Get Rows Where() call, then there is no meaningful difference.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 04:22:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-non-empty-row-values-corresponding-to-chosen-labels/m-p/718444#M90122</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-01-26T04:22:48Z</dc:date>
    </item>
  </channel>
</rss>

