<?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 as Table Variable in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Associative-Array-as-Table-Variable/m-p/894661#M105536</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;, your solution works great.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;, I upvoted this suggestion.&lt;/P&gt;</description>
    <pubDate>Fri, 15 Aug 2025 16:24:38 GMT</pubDate>
    <dc:creator>robot</dc:creator>
    <dc:date>2025-08-15T16:24:38Z</dc:date>
    <item>
      <title>Associative Array as Table Variable</title>
      <link>https://community.jmp.com/t5/Discussions/Associative-Array-as-Table-Variable/m-p/894509#M105525</link>
      <description>&lt;P&gt;Is it possible to create an&amp;nbsp;&lt;STRONG&gt;Associative Array&lt;/STRONG&gt; as a &lt;STRONG&gt;Table Variable&lt;/STRONG&gt; and then use stored values in a &lt;STRONG&gt;column formula&lt;/STRONG&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a number of related variables I would like to edit as part of an ongoing analysis.&amp;nbsp; These variables will then be used like a&amp;nbsp;&lt;STRONG&gt;Match&lt;/STRONG&gt;&amp;nbsp;function in a column formula.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Create table variable &lt;STRONG&gt;counts&lt;/STRONG&gt; and set value to&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;["a" =&amp;gt; 10, "b" =&amp;gt; 3, "c" =&amp;gt; 1]&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;STRONG&gt;counts&lt;/STRONG&gt; is then referenced by a column formula, like &lt;STRONG&gt;:counts[:col]&lt;/STRONG&gt;.&amp;nbsp; Where &lt;STRONG&gt;:col&lt;/STRONG&gt; is a Character column with values "a", "b", or "c".&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN&gt;Is this possible?&amp;nbsp; I am using JMP 18.2.1.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Aug 2025 00:14:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Associative-Array-as-Table-Variable/m-p/894509#M105525</guid>
      <dc:creator>robot</dc:creator>
      <dc:date>2025-08-15T00:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Associative Array as Table Variable</title>
      <link>https://community.jmp.com/t5/Discussions/Associative-Array-as-Table-Variable/m-p/894532#M105526</link>
      <description>&lt;P&gt;I think this does what you asked:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Table( "Untitled",
	Add Rows( 3 ),
	New Table Variable( "abc", "[\!"a\!"=&amp;gt;1, \!"b\!"=&amp;gt;2, \!"c\!"=&amp;gt;4]" ),
	New Column( "Column 1",
		Numeric,
		"Nominal",
		Format( "Best", 9 ),
		Formula(
			c_abc = As Constant( Eval( Parse( :abc ) ) );
			c_abc["c"];
		),
		Set Selected
	)
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note the table variable is just text, so it gets parsed and evaluated. The AsConstant function makes it only parse/eval once for the entire column's evaluation, so it won't be too inefficient.&lt;/P&gt;
&lt;P&gt;As an alternative, you could have a separate table variable for each element of the associative array. It might be easier to edit, but it won't create an isolated namespace like the associative array.&lt;/P&gt;
&lt;P&gt;Another alternative is to use custom column properties if the names are going to be column names. They might be harder to find and edit. Unlike the text-only table variable, they also hold expressions:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt=New Table( "Untitled",
	New Column( "Column 1",
		Set Property( "xxxxx", ["a"=&amp;gt;42,"adfasdfasdf"=&amp;gt;77] )
	)
);

(dt:column1&amp;lt;&amp;lt;getproperty("xxxxx"))["a"] // 42&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Aug 2025 02:06:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Associative-Array-as-Table-Variable/m-p/894532#M105526</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2025-08-15T02:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Associative Array as Table Variable</title>
      <link>https://community.jmp.com/t5/Discussions/Associative-Array-as-Table-Variable/m-p/894562#M105527</link>
      <description>&lt;P&gt;Craige did provide a good options how you can do this. Here is a wish list item hoping for more complicated data types for table variables&amp;nbsp;&lt;LI-MESSAGE title="Let us use more complicated data types for table variables than just text and numbers" uid="692118" url="https://community.jmp.com/t5/JMP-Wish-List/Let-us-use-more-complicated-data-types-for-table-variables-than/m-p/692118#U692118" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Aug 2025 05:49:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Associative-Array-as-Table-Variable/m-p/894562#M105527</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-08-15T05:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Associative Array as Table Variable</title>
      <link>https://community.jmp.com/t5/Discussions/Associative-Array-as-Table-Variable/m-p/894661#M105536</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;, your solution works great.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;, I upvoted this suggestion.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Aug 2025 16:24:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Associative-Array-as-Table-Variable/m-p/894661#M105536</guid>
      <dc:creator>robot</dc:creator>
      <dc:date>2025-08-15T16:24:38Z</dc:date>
    </item>
  </channel>
</rss>

