<?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 Add Value Labels to a Column through JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-Add-Value-Labels-to-a-Column-through-JSL/m-p/41660#M24294</link>
    <description>&lt;P&gt;Thank you very much it worked. Your response made it look so easy.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jul 2017 16:54:45 GMT</pubDate>
    <dc:creator>csoon1</dc:creator>
    <dc:date>2017-07-07T16:54:45Z</dc:date>
    <item>
      <title>How to Add Value Labels to a Column through JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Add-Value-Labels-to-a-Column-through-JSL/m-p/41604#M24271</link>
      <description>&lt;P&gt;On my main table (Table 1), I have a column called "Bin" which holds any number (corresponding to the column "Bin Number" entries on &amp;nbsp;another table which is Table 2). Now I want to assign Value Labels to this column "Bin" through script. The value labels would be coming from Table 2 with two columns: "Bin Number" and "Description".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hard-coding something like&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Column( dt, 1 ) &amp;lt;&amp;lt; Add Column Properties( Value Labels( {"1" = "Cool", "2" = "Awesome", "3" = "Bad"} ), Use Value Labels( 1 ) );&lt;/PRE&gt;&lt;P&gt;is simple enough. However I am struggling with how to create the expression with the value labels being dynamic and formulated from whats on the other table. On the above code, "1, 2, 3,..." are entries for "Bin Number" while "Cool, Awesome, Bad,..." are entries for "Description" from Table 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate it if you can point me to some neat tricks. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 21:43:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Add-Value-Labels-to-a-Column-through-JSL/m-p/41604#M24271</guid>
      <dc:creator>csoon1</dc:creator>
      <dc:date>2017-07-06T21:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to Add Value Labels to a Column through JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Add-Value-Labels-to-a-Column-through-JSL/m-p/41610#M24274</link>
      <description>&lt;P&gt;Here is one way to handle the issue. &amp;nbsp;It basically creates a string that contains the specific structure needed. &amp;nbsp;Then add it as an element into the list required to be used to add the Value Labels to the column.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = New Table( "Untitled 36", Add Rows( 3 ), 
	New Column( "Column 1", Character, "Nominal", 
	Set Values( {"1", "2", "3"} ) ) );

NamesList = {"Cool", "Awsome", "Bad"};
	
ValuesList = Column( dt, 1 ) &amp;lt;&amp;lt; get values;

NamesValuesList = {};

// Build the Value Labels List
For( i = 1, i &amp;lt;= N Items( NamesList ), i++,
	Insert Into( namesvalueslist, 
		Parse( "\!"" || ValuesList[i] || "\!" = \!"" || NamesList[i] || "\!"" ) )
);

// Create the Value Labels
Column( dt, 1 ) &amp;lt;&amp;lt; set property( "Value Labels", Eval( NamesValuesList ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Jul 2017 01:07:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Add-Value-Labels-to-a-Column-through-JSL/m-p/41610#M24274</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-07-07T01:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to Add Value Labels to a Column through JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Add-Value-Labels-to-a-Column-through-JSL/m-p/41660#M24294</link>
      <description>&lt;P&gt;Thank you very much it worked. Your response made it look so easy.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2017 16:54:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Add-Value-Labels-to-a-Column-through-JSL/m-p/41660#M24294</guid>
      <dc:creator>csoon1</dc:creator>
      <dc:date>2017-07-07T16:54:45Z</dc:date>
    </item>
  </channel>
</rss>

