<?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 How to filter rows of a data table with dynamical number of conditions? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-filter-rows-of-a-data-table-with-dynamical-number-of/m-p/684545#M87031</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to select rows based on the entries of selected rows from another table. Below a code snippet. The last row is not valid, but it should clarify what I mean.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;selected_row_idx = DT &amp;lt;&amp;lt; Get Selected Rows;
measurement_starts = DT:MeasurementStart[selected_row_idx];
measurement_ends = DT:MeasurementEnd[selected_row_idx];
DTmeas &amp;lt;&amp;lt; Select Where(measurement_starts[1] &amp;lt;= :TimeStamp &amp;lt;= measurement_ends[1] &amp;amp; measurement_starts[2] &amp;lt;= :TimeStamp &amp;lt;= measurement_ends[2] &amp;amp; ... &amp;amp; measurement_starts[n] &amp;lt;= :TimeStamp &amp;lt;= measurement_ends[n]);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How can I write the last row in some dynamical way, so that I have as many conditions there connected with "&amp;amp;" as I have rows selected in table DT? I could write a loop and filter subsets iteratively, but this is kind of lame. Or I could put together the last row as a string and parse and execute it, but that is not nice, either. Is there an elegant way to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Oct 2023 14:39:21 GMT</pubDate>
    <dc:creator>Robbb</dc:creator>
    <dc:date>2023-10-06T14:39:21Z</dc:date>
    <item>
      <title>How to filter rows of a data table with dynamical number of conditions?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-filter-rows-of-a-data-table-with-dynamical-number-of/m-p/684545#M87031</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to select rows based on the entries of selected rows from another table. Below a code snippet. The last row is not valid, but it should clarify what I mean.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;selected_row_idx = DT &amp;lt;&amp;lt; Get Selected Rows;
measurement_starts = DT:MeasurementStart[selected_row_idx];
measurement_ends = DT:MeasurementEnd[selected_row_idx];
DTmeas &amp;lt;&amp;lt; Select Where(measurement_starts[1] &amp;lt;= :TimeStamp &amp;lt;= measurement_ends[1] &amp;amp; measurement_starts[2] &amp;lt;= :TimeStamp &amp;lt;= measurement_ends[2] &amp;amp; ... &amp;amp; measurement_starts[n] &amp;lt;= :TimeStamp &amp;lt;= measurement_ends[n]);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How can I write the last row in some dynamical way, so that I have as many conditions there connected with "&amp;amp;" as I have rows selected in table DT? I could write a loop and filter subsets iteratively, but this is kind of lame. Or I could put together the last row as a string and parse and execute it, but that is not nice, either. Is there an elegant way to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 14:39:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-filter-rows-of-a-data-table-with-dynamical-number-of/m-p/684545#M87031</guid>
      <dc:creator>Robbb</dc:creator>
      <dc:date>2023-10-06T14:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter rows of a data table with dynamical number of conditions?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-filter-rows-of-a-data-table-with-dynamical-number-of/m-p/684566#M87035</link>
      <description>&lt;P&gt;I think you could use matrices, sql, building expression,...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt1 = New Table("Untitled",
	Add Rows(3),
	Compress File When Saved(1),
	New Column("A", Numeric, "Continuous", Format("Best", 12), Set Values([1, 1, 5])),
	New Column("B", Numeric, "Continuous", Format("Best", 12), Set Values([2, 3, 6]))
);
dt1 &amp;lt;&amp;lt; Select Rows(1::3);
starts = dt1[dt1 &amp;lt;&amp;lt; get selected rows, {"A"}];
ends = dt1[dt1 &amp;lt;&amp;lt; get selected rows, {"B"}];
dt1 &amp;lt;&amp;lt; clear select;

dt2 = New Table("Untitled 2",
	Add Rows(5),
	Compress File When Saved(1),
	New Column("Column 1", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2, 3, 4, 5]))
);

dt2 &amp;lt;&amp;lt; Select Where(
	N Items(Loc((starts &amp;lt;= :Column 1)` + (ends &amp;gt;= :Column 1)` &amp;gt;= 2)) &amp;gt; 0
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Oct 2023 15:18:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-filter-rows-of-a-data-table-with-dynamical-number-of/m-p/684566#M87035</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-10-06T15:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter rows of a data table with dynamical number of conditions?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-filter-rows-of-a-data-table-with-dynamical-number-of/m-p/684869#M87085</link>
      <description>&lt;P&gt;Very nice, thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 09:27:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-filter-rows-of-a-data-table-with-dynamical-number-of/m-p/684869#M87085</guid>
      <dc:creator>Robbb</dc:creator>
      <dc:date>2023-10-09T09:27:15Z</dc:date>
    </item>
  </channel>
</rss>

