<?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 How to multiply multiple columns by a constant? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-multiply-multiple-columns-by-a-constant/m-p/5002#M5001</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am working with a data table near ~250 columns. For about half of the columns, I need to multiply the column by 1000 (for mA).&lt;/P&gt;&lt;P&gt;I would like to do this without having to create a new column every time (reassigning the column). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Throwing this code into my script, I&amp;nbsp; have &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataTable("Temp")&amp;lt;&amp;lt; (:Col_To_Multiply *= 1000);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This equation is not changing my column at all, and its also not throwing any errors. &lt;/P&gt;&lt;P&gt;This is only for one column, and keep in mind I need to do this for ~125 columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on the equation or how to do this dynamically would be great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Jun 2012 21:10:12 GMT</pubDate>
    <dc:creator>matt_p</dc:creator>
    <dc:date>2012-06-06T21:10:12Z</dc:date>
    <item>
      <title>How to multiply multiple columns by a constant?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-multiply-multiple-columns-by-a-constant/m-p/5002#M5001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am working with a data table near ~250 columns. For about half of the columns, I need to multiply the column by 1000 (for mA).&lt;/P&gt;&lt;P&gt;I would like to do this without having to create a new column every time (reassigning the column). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Throwing this code into my script, I&amp;nbsp; have &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataTable("Temp")&amp;lt;&amp;lt; (:Col_To_Multiply *= 1000);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This equation is not changing my column at all, and its also not throwing any errors. &lt;/P&gt;&lt;P&gt;This is only for one column, and keep in mind I need to do this for ~125 columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on the equation or how to do this dynamically would be great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jun 2012 21:10:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-multiply-multiple-columns-by-a-constant/m-p/5002#M5001</guid>
      <dc:creator>matt_p</dc:creator>
      <dc:date>2012-06-06T21:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to multiply multiple columns by a constant?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-multiply-multiple-columns-by-a-constant/m-p/5003#M5002</link>
      <description>&lt;P&gt;Here is one way to do it (the script applies the factor 1000 to all columns. It is rather straighforward to adapt the for-loop to cover only columns of interest, i.e. loop over a list of those columns).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; color: #2600eb;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
For( i = 1, i &amp;lt;= N Col( dt ), i++,
  Column( i ) &amp;lt;&amp;lt; set values( (Column( i ) &amp;lt;&amp;lt; get as matrix) * 1000 )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 12:41:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-multiply-multiple-columns-by-a-constant/m-p/5003#M5002</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2018-06-15T12:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to multiply multiple columns by a constant?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-multiply-multiple-columns-by-a-constant/m-p/5004#M5003</link>
      <description>&lt;P&gt;Thanks for the help, worked awesome!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This was the final code I ended up if anyone else has this question:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
For( i = 1, i &amp;lt;= N Col(dt ), i++,
  a=Column(i) &amp;lt;&amp;lt; get name;
  if ( contains(a, "Col_To_Multiply"),
  Column( i ) &amp;lt;&amp;lt; set values( (Column( i ) &amp;lt;&amp;lt; get as matrix) * 1000 ),
 
  );
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 12:41:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-multiply-multiple-columns-by-a-constant/m-p/5004#M5003</guid>
      <dc:creator>matt_p</dc:creator>
      <dc:date>2018-06-15T12:41:39Z</dc:date>
    </item>
  </channel>
</rss>

