<?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 Can I Delete Rows Given A Condition in JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-Can-I-Delete-Rows-Given-A-Condition-in-JSL/m-p/718109#M90009</link>
    <description>&lt;P&gt;This is one way of handing the issue&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Current Data Table();

// Get the list of all parent_purification_runs values
allParentPurificationRuns = :parent_purification_runs &amp;lt;&amp;lt; get values;

For Each Row(
	If( Contains( allParentPurificationRuns, :purification_run ),
		dt &amp;lt;&amp;lt; Select Rows( Row() )
	)
);

Try( dt &amp;lt;&amp;lt; delete rows );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 22 Jan 2024 16:16:32 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2024-01-22T16:16:32Z</dc:date>
    <item>
      <title>How Can I Delete Rows Given A Condition in JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-Can-I-Delete-Rows-Given-A-Condition-in-JSL/m-p/718105#M90008</link>
      <description>&lt;P&gt;Hello. I am a JSL rookie but have some scripting experience with VBA and Python.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table that has two columns 'purification_run' and 'parent_purification_runs'. I want to delete each row that has a 'purification_run' field that is contained in any of the 'parent_purification_runs' fields. I wrote the following JSL script to accomplish this, and it runs, but does not perform the intended deletion. Can someone help put me on the right track? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Get handles to the columns
purificationRunCol = Column("purification_run");
parentPurificationRunsCol = Column("parent_purification_runs");

// Get the list of all unique parent_purification_runs values
allParentPurificationRuns = parentPurificationRunsCol &amp;lt;&amp;lt; Get Values;

// Iterate through each row
For Each Row(
    // Get the purification_run value for the current row
    currentPurificationRun = purificationRunCol &amp;lt;&amp;lt; Get As String;

    // Check if the purification_run is present in the list of parent_purification_runs
    If(Contains(allParentPurificationRuns, currentPurificationRun),

        // Delete the row if the condition is true
        Current Data Table() &amp;lt;&amp;lt; Delete Rows;
    );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Jan 2024 15:39:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-Can-I-Delete-Rows-Given-A-Condition-in-JSL/m-p/718105#M90008</guid>
      <dc:creator>bio_guy</dc:creator>
      <dc:date>2024-01-22T15:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Delete Rows Given A Condition in JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-Can-I-Delete-Rows-Given-A-Condition-in-JSL/m-p/718109#M90009</link>
      <description>&lt;P&gt;This is one way of handing the issue&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Current Data Table();

// Get the list of all parent_purification_runs values
allParentPurificationRuns = :parent_purification_runs &amp;lt;&amp;lt; get values;

For Each Row(
	If( Contains( allParentPurificationRuns, :purification_run ),
		dt &amp;lt;&amp;lt; Select Rows( Row() )
	)
);

Try( dt &amp;lt;&amp;lt; delete rows );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Jan 2024 16:16:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-Can-I-Delete-Rows-Given-A-Condition-in-JSL/m-p/718109#M90009</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-01-22T16:16:32Z</dc:date>
    </item>
  </channel>
</rss>

