<?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 store unique column values as a list in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-store-unique-column-values-as-a-list/m-p/489459#M73259</link>
    <description>&lt;P&gt;Here are 2 ways of doing what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dtbl = Current Data Table();

newList = Associative Array( dtbl:type &amp;lt;&amp;lt; get values ) &amp;lt;&amp;lt; get keys;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dtbl = Current Data Table();

Summarize( dtbl, newlist = by( :Type ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 21 May 2022 09:10:30 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2022-05-21T09:10:30Z</dc:date>
    <item>
      <title>How to store unique column values as a list</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-store-unique-column-values-as-a-list/m-p/489436#M73258</link>
      <description>&lt;P&gt;I am trying to take a single column from my data table and store each unique value to a list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ex:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;column is named "Type" and the values in rows 1-6 are "A,B,C,A,B,C"&lt;/P&gt;
&lt;P&gt;I currently have:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtbl = Current Data Table();
newlist = column("Type") &amp;lt;&amp;lt;Getvalues();
Show(newlist);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which returns "A,B,C,A,B,C", but I am trying to get a list which would contain "A,B,C" instead. Any help would be appreciated (I am also new to JSL)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:48:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-store-unique-column-values-as-a-list/m-p/489436#M73258</guid>
      <dc:creator>Ckaiser</dc:creator>
      <dc:date>2023-06-10T23:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to store unique column values as a list</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-store-unique-column-values-as-a-list/m-p/489459#M73259</link>
      <description>&lt;P&gt;Here are 2 ways of doing what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dtbl = Current Data Table();

newList = Associative Array( dtbl:type &amp;lt;&amp;lt; get values ) &amp;lt;&amp;lt; get keys;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dtbl = Current Data Table();

Summarize( dtbl, newlist = by( :Type ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 21 May 2022 09:10:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-store-unique-column-values-as-a-list/m-p/489459#M73259</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-05-21T09:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to store unique column values as a list</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-store-unique-column-values-as-a-list/m-p/489740#M73270</link>
      <description>&lt;P&gt;Here is one more option using Summary. Getting unique values from &lt;SPAN class="lia-emoticons-autosuggestions"&gt;&lt;SPAN class="lia-emoticons-search-term"&gt;:name column&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

dt_summary = Data Table("Big Class") &amp;lt;&amp;lt; Summary(
	Group(:name),
	Freq("None"),
	Weight("None"),
	Link to original data table(0),
	private
);

uniq_vals = dt_summary[0,1];
Close(dt_summary, no save);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Do note that if you have numeric column and you want to get unique numbers, &lt;STRONG&gt;Summarize&lt;/STRONG&gt; will return them as characters and not numbers.&lt;/P&gt;</description>
      <pubDate>Sun, 22 May 2022 16:27:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-store-unique-column-values-as-a-list/m-p/489740#M73270</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-05-22T16:27:34Z</dc:date>
    </item>
  </channel>
</rss>

