<?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 easily import/assign units property to multiple columns? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-easily-import-assign-units-property-to-multiple-columns/m-p/8154#M8148</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;mpb:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks. That works. I'm new to scripting and still shaky when it comes to using eval.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also posed this question to my regional JMP support person Jerry Cooper. His solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Names Default To Here( 1 );&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;dt = Current Data Table();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;mycols = dt &amp;lt;&amp;lt; Get Column Names( string );&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;For( i = 1, i &amp;lt;= N Items( mycols ), i++,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; If( Contains( mycols&lt;I&gt;, "-" ),&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; myunits = Substr( mycols&lt;I&gt;, Contains( mycols&lt;I&gt;, "-", -1 ) + 1 );&lt;/I&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; newname = Substr( mycols&lt;I&gt;, 1, Contains( mycols&lt;I&gt;, "-", -1 ) - 1 );&lt;/I&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; Column( i ) &amp;lt;&amp;lt; Set Name( newname );&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; Column( i ) &amp;lt;&amp;lt; Set Property( "Units", eval(myunits) );&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;He contacted the developers to add this feature to the Excel Import Wizard. Another situation requiring something similar is specification limits. How to import them with the data and assign them to the column properties.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Mar 2014 01:23:45 GMT</pubDate>
    <dc:creator>markschahl</dc:creator>
    <dc:date>2014-03-04T01:23:45Z</dc:date>
    <item>
      <title>How to easily import/assign units property to multiple columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-easily-import-assign-units-property-to-multiple-columns/m-p/8152#M8146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I work in the petrochemical industry and like others in the process industries, I use JMP to analyze continuous/batch process measurements time-series data. Column 1 is a timestamp, columns 2 though n are process measurements like; flow; pressure; temperature; rpm; mass, etc.. The data are queried from a process historian database into Excel. The first row contains the measurement name and the second row contains the measurement units: kg/hr; deg C; kPa; psig; kbbl/hr; etc.. Is there a way have the units information assigned to the Units column property? Would be a great feature in the Excel import wizard.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 16:23:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-easily-import-assign-units-property-to-multiple-columns/m-p/8152#M8146</guid>
      <dc:creator>markschahl</dc:creator>
      <dc:date>2014-02-27T16:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to easily import/assign units property to multiple columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-easily-import-assign-units-property-to-multiple-columns/m-p/8153#M8147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In JMP 11 the excellent Excel import wizard lets you specify how many rows are to be considered headers and where they are, and then lets you specify where the data is. Doing this interactively or using the script that gets embedded in the resulting JMP file, you can take an Excel sheet that looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Length&amp;nbsp;&amp;nbsp;&amp;nbsp; Width&amp;nbsp;&amp;nbsp;&amp;nbsp; Weight&lt;/P&gt;&lt;P&gt;ft&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lb&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&amp;nbsp;&amp;nbsp;&amp;nbsp; 100&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp; 20&amp;nbsp;&amp;nbsp;&amp;nbsp; 200&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&amp;nbsp;&amp;nbsp;&amp;nbsp; 300&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp; 40&amp;nbsp;&amp;nbsp;&amp;nbsp; 400&lt;/P&gt;&lt;P&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp; 50&amp;nbsp;&amp;nbsp;&amp;nbsp; 500&lt;/P&gt;&lt;P&gt;6&amp;nbsp;&amp;nbsp;&amp;nbsp; 60&amp;nbsp;&amp;nbsp;&amp;nbsp; 600&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and end up with a JMP table that looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="192"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="64"&gt;Length-ft&lt;/TD&gt;&lt;TD width="64"&gt;Width-in&lt;/TD&gt;&lt;TD width="64"&gt;Weight-lb&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;1&lt;/TD&gt;&lt;TD align="right"&gt;10&lt;/TD&gt;&lt;TD align="right"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;2&lt;/TD&gt;&lt;TD align="right"&gt;20&lt;/TD&gt;&lt;TD align="right"&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;3&lt;/TD&gt;&lt;TD align="right"&gt;30&lt;/TD&gt;&lt;TD align="right"&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;4&lt;/TD&gt;&lt;TD align="right"&gt;40&lt;/TD&gt;&lt;TD align="right"&gt;400&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;5&lt;/TD&gt;&lt;TD align="right"&gt;50&lt;/TD&gt;&lt;TD align="right"&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;6&lt;/TD&gt;&lt;TD align="right"&gt;60&lt;/TD&gt;&lt;TD align="right"&gt;600&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;If that is adequate then you are done. If not then you can run a script something like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dt = Current Data Table();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For( colnum = 1, colnum &amp;lt;= 3, colnum++, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; col = Column Name( colnum );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; charcol = Char( Column Name( colnum ) );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; colname = Word( 1, charcol, "-" );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; colunit = Word( 2, charcol, "-" );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newcolname = col &amp;lt;&amp;lt; Set Name( colname );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newcolname &amp;lt;&amp;lt; Set Property( "Units", Eval( colunit ) );&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to end up with a JMP table that looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Length&amp;nbsp;&amp;nbsp;&amp;nbsp; Width&amp;nbsp;&amp;nbsp;&amp;nbsp; Weight&lt;/P&gt;&lt;P&gt;(ft)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (in)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (lb)&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&amp;nbsp;&amp;nbsp;&amp;nbsp; 100&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp; 20&amp;nbsp;&amp;nbsp;&amp;nbsp; 200&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&amp;nbsp;&amp;nbsp;&amp;nbsp; 300&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp; 40&amp;nbsp;&amp;nbsp;&amp;nbsp; 400&lt;/P&gt;&lt;P&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp; 50&amp;nbsp;&amp;nbsp;&amp;nbsp; 500&lt;/P&gt;&lt;P&gt;6&amp;nbsp;&amp;nbsp;&amp;nbsp; 60&amp;nbsp;&amp;nbsp;&amp;nbsp; 600&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where the text between parentheses are entered into the Units property of each column.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Mar 2014 19:58:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-easily-import-assign-units-property-to-multiple-columns/m-p/8153#M8147</guid>
      <dc:creator>mpb</dc:creator>
      <dc:date>2014-03-03T19:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to easily import/assign units property to multiple columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-easily-import-assign-units-property-to-multiple-columns/m-p/8154#M8148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;mpb:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks. That works. I'm new to scripting and still shaky when it comes to using eval.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also posed this question to my regional JMP support person Jerry Cooper. His solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Names Default To Here( 1 );&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;dt = Current Data Table();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;mycols = dt &amp;lt;&amp;lt; Get Column Names( string );&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;For( i = 1, i &amp;lt;= N Items( mycols ), i++,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; If( Contains( mycols&lt;I&gt;, "-" ),&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; myunits = Substr( mycols&lt;I&gt;, Contains( mycols&lt;I&gt;, "-", -1 ) + 1 );&lt;/I&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; newname = Substr( mycols&lt;I&gt;, 1, Contains( mycols&lt;I&gt;, "-", -1 ) - 1 );&lt;/I&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; Column( i ) &amp;lt;&amp;lt; Set Name( newname );&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; Column( i ) &amp;lt;&amp;lt; Set Property( "Units", eval(myunits) );&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;He contacted the developers to add this feature to the Excel Import Wizard. Another situation requiring something similar is specification limits. How to import them with the data and assign them to the column properties.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Mar 2014 01:23:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-easily-import-assign-units-property-to-multiple-columns/m-p/8154#M8148</guid>
      <dc:creator>markschahl</dc:creator>
      <dc:date>2014-03-04T01:23:45Z</dc:date>
    </item>
  </channel>
</rss>

