<?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 Trying to use Remove(source, {items}) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Trying-to-use-Remove-source-items/m-p/504884#M73641</link>
    <description>&lt;P&gt;I'm trying to remove 2 items from a list but I'm getting this error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"index must be number or list of numbers at row 1 in access or evaluation of 'List' , {/*###*/lst2}"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;lst = As List((Associative Array( dt1:Name &amp;lt;&amp;lt; get values ) &amp;lt;&amp;lt; Get Keys))
lst2 = As List( {"NTC","PC"})
Remove( lst, {lst2})

lst = As List((Associative Array( dt1:Name &amp;lt;&amp;lt; get values ) &amp;lt;&amp;lt; Get Keys))
lst2 = As List( {"Pete","Clare"})
Remove( lst, lst2)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I've tried both there options and they both return an error. Where am I going wrong?&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 17:00:54 GMT</pubDate>
    <dc:creator>Agustin</dc:creator>
    <dc:date>2023-06-09T17:00:54Z</dc:date>
    <item>
      <title>Trying to use Remove(source, {items})</title>
      <link>https://community.jmp.com/t5/Discussions/Trying-to-use-Remove-source-items/m-p/504884#M73641</link>
      <description>&lt;P&gt;I'm trying to remove 2 items from a list but I'm getting this error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"index must be number or list of numbers at row 1 in access or evaluation of 'List' , {/*###*/lst2}"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;lst = As List((Associative Array( dt1:Name &amp;lt;&amp;lt; get values ) &amp;lt;&amp;lt; Get Keys))
lst2 = As List( {"NTC","PC"})
Remove( lst, {lst2})

lst = As List((Associative Array( dt1:Name &amp;lt;&amp;lt; get values ) &amp;lt;&amp;lt; Get Keys))
lst2 = As List( {"Pete","Clare"})
Remove( lst, lst2)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I've tried both there options and they both return an error. Where am I going wrong?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 17:00:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trying-to-use-Remove-source-items/m-p/504884#M73641</guid>
      <dc:creator>Agustin</dc:creator>
      <dc:date>2023-06-09T17:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use Remove(source, {items})</title>
      <link>https://community.jmp.com/t5/Discussions/Trying-to-use-Remove-source-items/m-p/504926#M73642</link>
      <description>&lt;P&gt;Error message is quite clear here, you need to have number or list of number which you use for deletion, not a list of strings&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1654852474195.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/43123i711651F179B4AA76/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1654852474195.png" alt="jthi_0-1654852474195.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without knowing more about what you are trying to do, you could for example use Filter Each or Associative Array&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 = Open("$SAMPLE_DATA/Big Class.jmp");

lst = Associative Array(dt:Name &amp;lt;&amp;lt; get values);
lst2 = Associative Array({"KATIE", "BARBARA"});
show(Contains(lst, "KATIE"));
lst &amp;lt;&amp;lt; Remove(lst2);
lst = lst &amp;lt;&amp;lt; get keys;
show(Contains(lst, "KATIE"));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/en/16.2/#page/jmp/work-with-associative-arrays.shtml" target="_self"&gt;Work with Associative Arrays (jmp.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 09:17:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trying-to-use-Remove-source-items/m-p/504926#M73642</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-06-10T09:17:44Z</dc:date>
    </item>
  </channel>
</rss>

