<?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 Appending element to a list value inside an associative array in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Appending-element-to-a-list-value-inside-an-associative-array/m-p/214899#M42970</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to add an element into an associative array where the value is a list and the element needs to be added into the list inside associative array.&lt;/P&gt;&lt;P&gt;Eg:&lt;/P&gt;&lt;P&gt;cary = ["high schools" =&amp;gt; {"Cary", "Green Hope", "Panther Creek"}, "population" =&amp;gt; 116244, "state" =&amp;gt; "NC", "weather" =&amp;gt; "sunny"];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this,&lt;/P&gt;&lt;P&gt;1. How can I add a new entry to "high schools" list?&lt;/P&gt;&lt;P&gt;2. How do I convert the "weather" value to list? i.e. "weather" =&amp;gt; {"sunny", "humid"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help regarding this is much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Dileep&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jun 2019 01:01:45 GMT</pubDate>
    <dc:creator>dileepkr</dc:creator>
    <dc:date>2019-06-27T01:01:45Z</dc:date>
    <item>
      <title>Appending element to a list value inside an associative array</title>
      <link>https://community.jmp.com/t5/Discussions/Appending-element-to-a-list-value-inside-an-associative-array/m-p/214899#M42970</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to add an element into an associative array where the value is a list and the element needs to be added into the list inside associative array.&lt;/P&gt;&lt;P&gt;Eg:&lt;/P&gt;&lt;P&gt;cary = ["high schools" =&amp;gt; {"Cary", "Green Hope", "Panther Creek"}, "population" =&amp;gt; 116244, "state" =&amp;gt; "NC", "weather" =&amp;gt; "sunny"];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this,&lt;/P&gt;&lt;P&gt;1. How can I add a new entry to "high schools" list?&lt;/P&gt;&lt;P&gt;2. How do I convert the "weather" value to list? i.e. "weather" =&amp;gt; {"sunny", "humid"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help regarding this is much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Dileep&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 01:01:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Appending-element-to-a-list-value-inside-an-associative-array/m-p/214899#M42970</guid>
      <dc:creator>dileepkr</dc:creator>
      <dc:date>2019-06-27T01:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Appending element to a list value inside an associative array</title>
      <link>https://community.jmp.com/t5/Discussions/Appending-element-to-a-list-value-inside-an-associative-array/m-p/214910#M42972</link>
      <description>&lt;P&gt;There's likely a simpler way but the below seems to work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;cary = ["high schools" =&amp;gt; {"Cary", "Green Hope", "Panther Creek"}, "population" =&amp;gt; 116244,
"state" =&amp;gt; "NC",
"weather" =&amp;gt; "sunny"];

// 1.
cary &amp;lt;&amp;lt; Insert("high schools", Insert(cary["high schools"], "another school"));
// 2.
cary &amp;lt;&amp;lt; Insert("weather", Eval List(Insert(List(cary["weather"]), "humid")));

Show(cary);
/*:

cary = ["high schools" =&amp;gt; {"Cary", "Green Hope", "Panther Creek", "another school"}, "population" =&amp;gt; 116244, "state" =&amp;gt; "NC", "weather" =&amp;gt; {"sunny", "humid"}];&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 01:17:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Appending-element-to-a-list-value-inside-an-associative-array/m-p/214910#M42972</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2019-06-27T01:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Appending element to a list value inside an associative array</title>
      <link>https://community.jmp.com/t5/Discussions/Appending-element-to-a-list-value-inside-an-associative-array/m-p/214965#M42975</link>
      <description>&lt;P&gt;There is usually more than one way with JSL. Here is my way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;cary = ["high schools" =&amp;gt; {"Cary", "Green Hope", "Panther Creek"}, "population" =&amp;gt; 116244, "state" =&amp;gt; "NC", "weather" =&amp;gt; "sunny"];

Insert Into( cary["high schools"], "Black Bear" );

cary["weather"] = { "sunny", "humid" };&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I am sure that the specific details will determine which way is best for you in this case.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 09:27:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Appending-element-to-a-list-value-inside-an-associative-array/m-p/214965#M42975</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-06-27T09:27:15Z</dc:date>
    </item>
  </channel>
</rss>

