<?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 do I multiply all data values by a multiplier for each column that is identified in another table? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-multiply-all-data-values-by-a-multiplier-for-each/m-p/468631#M71245</link>
    <description>&lt;P&gt;How do I multiply all data values by a multiplier for each column that is in another table, by column name? (The multiplier table has a column with the column names and a second column with the multipliers to apply to each column in the other table. Not all columns have a multiplier.) I can get as far as adding the multiplier to the data table in its own row, but then I'm stuck. I know I can do it quickly externally but I’m sure there’s a way to do it in JMP.&lt;/P&gt;</description>
    <pubDate>Sat, 10 Jun 2023 23:45:31 GMT</pubDate>
    <dc:creator>dlifke</dc:creator>
    <dc:date>2023-06-10T23:45:31Z</dc:date>
    <item>
      <title>How do I multiply all data values by a multiplier for each column that is identified in another table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-multiply-all-data-values-by-a-multiplier-for-each/m-p/468631#M71245</link>
      <description>&lt;P&gt;How do I multiply all data values by a multiplier for each column that is in another table, by column name? (The multiplier table has a column with the column names and a second column with the multipliers to apply to each column in the other table. Not all columns have a multiplier.) I can get as far as adding the multiplier to the data table in its own row, but then I'm stuck. I know I can do it quickly externally but I’m sure there’s a way to do it in JMP.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:45:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-multiply-all-data-values-by-a-multiplier-for-each/m-p/468631#M71245</guid>
      <dc:creator>dlifke</dc:creator>
      <dc:date>2023-06-10T23:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I multiply all data values by a multiplier for each column that is identified in another table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-multiply-all-data-values-by-a-multiplier-for-each/m-p/468670#M71247</link>
      <description>&lt;P&gt;Here is a simple example of changing the values in the Big Class data table, based upon a config data table as you describe.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
// Open Data Table: big class.jmp
// → Data Table( "big class" )
dt = Open( "$SAMPLE_DATA/big class.jmp" );

dtConfig = New Table( "Config",
	New Column( "Name", character, values( {"age", "height", "weight"} ) ),
	New Column( "multiplier", values( {3, ., 2} ) )
);

dtColNames = dt &amp;lt;&amp;lt; get column names( string );

For( i = 1, i &amp;lt;= N Rows( dtConfig ), i++,
	If( Contains( dtColNames, dtConfig:Name[i] ) &amp;amp; Is Missing( dtConfig:multiplier[i] ) == 0,
		temp = Column( dt, dtConfig:Name[i] ) &amp;lt;&amp;lt; get values;
		temp = temp :*&lt;/img&gt; dtConfig:multiplier[i];
		Column( dt, dtConfig:Name[i] ) &amp;lt;&amp;lt; set values( temp );
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Mar 2022 23:31:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-multiply-all-data-values-by-a-multiplier-for-each/m-p/468670#M71247</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-03-10T23:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I multiply all data values by a multiplier for each column that is identified in another table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-multiply-all-data-values-by-a-multiplier-for-each/m-p/468995#M71281</link>
      <description>&lt;P&gt;Thanks! I passed it along to the internal customer. I presume the middle section dtConfig would not be necessary, since the multiplier table already exists. (You were just creating a new multiplier table to use on big class as an example.)&amp;nbsp; In the For loop he'd just replace dtConfig with the name of his multiplier table. Does that sound about right? Thanks again!&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 17:56:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-multiply-all-data-values-by-a-multiplier-for-each/m-p/468995#M71281</guid>
      <dc:creator>dlifke</dc:creator>
      <dc:date>2022-03-11T17:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I multiply all data values by a multiplier for each column that is identified in another table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-multiply-all-data-values-by-a-multiplier-for-each/m-p/468997#M71283</link>
      <description>&lt;P&gt;You are correct....&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 18:30:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-multiply-all-data-values-by-a-multiplier-for-each/m-p/468997#M71283</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-03-11T18:30:15Z</dc:date>
    </item>
  </channel>
</rss>

