<?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: Associative Array from variables in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Associative-Array-from-variables/m-p/499725#M73499</link>
    <description>&lt;P&gt;This does not produce the desired result. Keep in mind, keys are "AA" and "BB", and values for those keys are lists a and b, respectively.&lt;/P&gt;&lt;P&gt;But it got me on the correct track, so this works as intended:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;a = {"a1", "a2", "a3"};
b = {"b1", "b2", "b3"};


keys = {"AA", "BB"};
values = Eval List({a, b});


AB = Associative Array({keys, values});

AB["AA"];&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S. Actually it doesn't work either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't understand how JMP decides which one to use if my values are lists too??&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//Create an associative array from a list that contains two lists of a key-value pair:

map = Associative Array( {{"yes", 0}, {"no", 1}} );

//Create an associative array from a list of keys and a list of values:

map = Associative Array( {"yes", "no"}, {0, 1} );

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jun 2022 22:09:13 GMT</pubDate>
    <dc:creator>miguello</dc:creator>
    <dc:date>2022-06-03T22:09:13Z</dc:date>
    <item>
      <title>Associative Array from variables</title>
      <link>https://community.jmp.com/t5/Discussions/Associative-Array-from-variables/m-p/499678#M73497</link>
      <description>&lt;P&gt;Can somebody help me with a correct syntax&amp;nbsp; to create Associative Array from variables?&lt;/P&gt;&lt;P&gt;Now I have this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;a = {"a1", "a2", "a3"};
b = {"b1", "b2", "b3"};

AB = [
	"AA" =&amp;gt; a,
	"BB" =&amp;gt; b
];

AB["AA"];&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It returns:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;/*:

a&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I want it to return:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;/*:

{"a1", "a2", "a3"}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I tried different combinations of &lt;EM&gt;Eval List()&lt;/EM&gt;, &lt;EM&gt;Eval Expr()&lt;/EM&gt;, &lt;EM&gt;Expr()&lt;/EM&gt; and &lt;EM&gt;Eval()&lt;/EM&gt;, but no luck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 17:00:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Associative-Array-from-variables/m-p/499678#M73497</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2023-06-09T17:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Associative Array from variables</title>
      <link>https://community.jmp.com/t5/Discussions/Associative-Array-from-variables/m-p/499707#M73498</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;AB = Associative Array(EvalList({a, b}))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Jun 2022 21:29:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Associative-Array-from-variables/m-p/499707#M73498</guid>
      <dc:creator>Jasean</dc:creator>
      <dc:date>2022-06-03T21:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Associative Array from variables</title>
      <link>https://community.jmp.com/t5/Discussions/Associative-Array-from-variables/m-p/499725#M73499</link>
      <description>&lt;P&gt;This does not produce the desired result. Keep in mind, keys are "AA" and "BB", and values for those keys are lists a and b, respectively.&lt;/P&gt;&lt;P&gt;But it got me on the correct track, so this works as intended:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;a = {"a1", "a2", "a3"};
b = {"b1", "b2", "b3"};


keys = {"AA", "BB"};
values = Eval List({a, b});


AB = Associative Array({keys, values});

AB["AA"];&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S. Actually it doesn't work either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't understand how JMP decides which one to use if my values are lists too??&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//Create an associative array from a list that contains two lists of a key-value pair:

map = Associative Array( {{"yes", 0}, {"no", 1}} );

//Create an associative array from a list of keys and a list of values:

map = Associative Array( {"yes", "no"}, {0, 1} );

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 22:09:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Associative-Array-from-variables/m-p/499725#M73499</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2022-06-03T22:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Associative Array from variables</title>
      <link>https://community.jmp.com/t5/Discussions/Associative-Array-from-variables/m-p/499741#M73501</link>
      <description>&lt;P&gt;Had to go brute force way for now:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;AB = Associative Array();
AB["AA"] = Eval List(a);
AB["BB"] = Eval List(b);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Jun 2022 22:14:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Associative-Array-from-variables/m-p/499741#M73501</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2022-06-03T22:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: Associative Array from variables</title>
      <link>https://community.jmp.com/t5/Discussions/Associative-Array-from-variables/m-p/499762#M73502</link>
      <description>&lt;P&gt;You almost had it!&amp;nbsp; You need to input the arguments to &lt;CODE class=" language-jsl"&gt;Associative Array()&lt;/CODE&gt; as &lt;CODE class=" language-jsl"&gt;Associative Array( keys, values )&lt;/CODE&gt;, instead of &lt;CODE class=" language-jsl"&gt;Associative Array( {keys, values} )&lt;/CODE&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;a = {"a1", "a2", "a3"};
b = {"b1", "b2", "b3"};


keys = {"AA", "BB"};
values = Eval List({a, b});


AB = Associative Array(keys, values);

AB["AA"];&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 04 Jun 2022 00:59:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Associative-Array-from-variables/m-p/499762#M73502</guid>
      <dc:creator>ErraticAttack</dc:creator>
      <dc:date>2022-06-04T00:59:30Z</dc:date>
    </item>
  </channel>
</rss>

