<?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 dt:ColName &amp;lt;&amp;lt; Set Data Type(&amp;quot;Numeric&amp;quot;) deletes values that have a decimal point in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/dt-ColName-lt-lt-Set-Data-Type-quot-Numeric-quot-deletes-values/m-p/542063#M76173</link>
    <description>&lt;P&gt;I have a Data table with some data that I imported from a text file, which contains columns that by default have Data Type == Character and Modeling Type == Nominal. These columns contain numbers, of which some have a decimal point and some digits behind the decimal point. I wish to transform these columns to Numeric, Continuous, Engineering SI, but I have run into some strange behavior. Namely, in some cases the values in the column which contain a decimal point will be deleted (their value is set to ".").&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried two approaches:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Changing the columns manually using Column Info:&lt;/P&gt;&lt;P&gt;- If I change all three fields at once to Numeric, Continuous, Engineering SI, and then click "Apply", then the values that contain a decimal point will be reset to "."&lt;/P&gt;&lt;P&gt;- If I press "Apply" after changing each field (so 3 times total), then the values are correctly formatted and everything works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Changing the columns using JSL: (This is what I actually want to do)&lt;/P&gt;&lt;P&gt;My code to set all three fields at once:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
dt:ColumnName &amp;lt;&amp;lt;  Set Data type( "Numeric" )&amp;nbsp;&amp;lt;&amp;lt; Set Modeling&amp;nbsp;Type(&amp;nbsp;"Continuous"&amp;nbsp;)&amp;nbsp;&amp;lt;&amp;lt;&amp;nbsp;Set&amp;nbsp;Format( "Engineering&amp;nbsp;SI",&amp;nbsp;12,&amp;nbsp;5);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This will reset all values in the column ColumnName to ".". I have also tried using column(dt, "ColumnName") instead of dt:ColumnName, and to only set one field at a time, but the result is the same. The code seems to run fine. It does write "Scriptable[]" to the terminal, but I haven't been able to find out what this means.&lt;/P&gt;</description>
    <pubDate>Sat, 10 Jun 2023 23:53:59 GMT</pubDate>
    <dc:creator>AutoSalamander3</dc:creator>
    <dc:date>2023-06-10T23:53:59Z</dc:date>
    <item>
      <title>dt:ColName &lt;&lt; Set Data Type("Numeric") deletes values that have a decimal point</title>
      <link>https://community.jmp.com/t5/Discussions/dt-ColName-lt-lt-Set-Data-Type-quot-Numeric-quot-deletes-values/m-p/542063#M76173</link>
      <description>&lt;P&gt;I have a Data table with some data that I imported from a text file, which contains columns that by default have Data Type == Character and Modeling Type == Nominal. These columns contain numbers, of which some have a decimal point and some digits behind the decimal point. I wish to transform these columns to Numeric, Continuous, Engineering SI, but I have run into some strange behavior. Namely, in some cases the values in the column which contain a decimal point will be deleted (their value is set to ".").&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried two approaches:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Changing the columns manually using Column Info:&lt;/P&gt;&lt;P&gt;- If I change all three fields at once to Numeric, Continuous, Engineering SI, and then click "Apply", then the values that contain a decimal point will be reset to "."&lt;/P&gt;&lt;P&gt;- If I press "Apply" after changing each field (so 3 times total), then the values are correctly formatted and everything works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Changing the columns using JSL: (This is what I actually want to do)&lt;/P&gt;&lt;P&gt;My code to set all three fields at once:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
dt:ColumnName &amp;lt;&amp;lt;  Set Data type( "Numeric" )&amp;nbsp;&amp;lt;&amp;lt; Set Modeling&amp;nbsp;Type(&amp;nbsp;"Continuous"&amp;nbsp;)&amp;nbsp;&amp;lt;&amp;lt;&amp;nbsp;Set&amp;nbsp;Format( "Engineering&amp;nbsp;SI",&amp;nbsp;12,&amp;nbsp;5);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This will reset all values in the column ColumnName to ".". I have also tried using column(dt, "ColumnName") instead of dt:ColumnName, and to only set one field at a time, but the result is the same. The code seems to run fine. It does write "Scriptable[]" to the terminal, but I haven't been able to find out what this means.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:53:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/dt-ColName-lt-lt-Set-Data-Type-quot-Numeric-quot-deletes-values/m-p/542063#M76173</guid>
      <dc:creator>AutoSalamander3</dc:creator>
      <dc:date>2023-06-10T23:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: dt:ColName &lt;&lt; Set Data Type("Numeric") deletes values that have a decimal point</title>
      <link>https://community.jmp.com/t5/Discussions/dt-ColName-lt-lt-Set-Data-Type-quot-Numeric-quot-deletes-values/m-p/542084#M76174</link>
      <description>&lt;P&gt;You are probably in Europe and your local is set to use , as the decimal seperator. Do a search and replace on the column first replacing . by , then your code should work.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2022 09:49:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/dt-ColName-lt-lt-Set-Data-Type-quot-Numeric-quot-deletes-values/m-p/542084#M76174</guid>
      <dc:creator>pauldeen</dc:creator>
      <dc:date>2022-09-08T09:49:23Z</dc:date>
    </item>
  </channel>
</rss>

