<?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 create an array from Column Names and values. in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-create-an-array-from-Column-Names-and-values/m-p/353444#M60292</link>
    <description>&lt;P&gt;You could do something like this...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
keysList = dt &amp;lt;&amp;lt; Get Column Names( string );
tablData = {};
For( i = 1, i &amp;lt;= N Items( KeysList ), i++,
	Insert Into( tablData, Column( KeysList[i] )[1] )
); //end of For
aa = Eval List( Associative Array( keysList, tablData ) );
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jan 2021 20:57:21 GMT</pubDate>
    <dc:creator>Wendy_Murphrey</dc:creator>
    <dc:date>2021-01-27T20:57:21Z</dc:date>
    <item>
      <title>How to create an array from Column Names and values.</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-create-an-array-from-Column-Names-and-values/m-p/353399#M60287</link>
      <description>&lt;P&gt;I have a table that has 3 columns and a single row of values and I am trying to create an Associative array from it,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ALopez_0-1611777859364.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/29783i1A8DB7971FABF4FD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ALopez_0-1611777859364.png" alt="ALopez_0-1611777859364.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have tried this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
keysList =  dt &amp;lt;&amp;lt; Get Column Names(string);
tablData = Associative Array();
For(i=1, i &amp;lt;= N Items(KeysList), i++,
tablData&amp;lt;&amp;lt; Insert(KeysList[i])
); //end of For
tablData &amp;lt;&amp;lt; Get Values;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The array is created but all the values are =&amp;gt; 1.&lt;/P&gt;&lt;P&gt;I was expecting :&amp;nbsp;tablData = ["deep" =&amp;gt; 40, "length" =&amp;gt; 20, "width" =&amp;gt; 10];&lt;/P&gt;&lt;P&gt;I will appreciate your help fixing my code.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:25:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-create-an-array-from-Column-Names-and-values/m-p/353399#M60287</guid>
      <dc:creator>ALopez</dc:creator>
      <dc:date>2023-06-10T23:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an array from Column Names and values.</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-create-an-array-from-Column-Names-and-values/m-p/353444#M60292</link>
      <description>&lt;P&gt;You could do something like this...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
keysList = dt &amp;lt;&amp;lt; Get Column Names( string );
tablData = {};
For( i = 1, i &amp;lt;= N Items( KeysList ), i++,
	Insert Into( tablData, Column( KeysList[i] )[1] )
); //end of For
aa = Eval List( Associative Array( keysList, tablData ) );
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 20:57:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-create-an-array-from-Column-Names-and-values/m-p/353444#M60292</guid>
      <dc:creator>Wendy_Murphrey</dc:creator>
      <dc:date>2021-01-27T20:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an array from Column Names and values.</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-create-an-array-from-Column-Names-and-values/m-p/353446#M60294</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5579"&gt;@Wendy_Murphrey&lt;/a&gt;. I had a tried something similar but I always forget the "Eval List".&amp;nbsp;&amp;nbsp;Thank you very much for your help and the lesson.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 21:24:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-create-an-array-from-Column-Names-and-values/m-p/353446#M60294</guid>
      <dc:creator>ALopez</dc:creator>
      <dc:date>2021-01-27T21:24:47Z</dc:date>
    </item>
  </channel>
</rss>

