<?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 get a sum of all columns with names stored in a list in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/how-to-get-a-sum-of-all-columns-with-names-stored-in-a-list/m-p/63140#M33911</link>
    <description>&lt;P&gt;I have create a list of column containing roughly the same name below:&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;Xlist = {};
Ylist = {};
for(i = 1, i &amp;lt; ncols(dt2), i++,
if(
contains(dt2:i&amp;lt;&amp;lt; get name, "XXX") &amp;gt; 0, insert into(Xlist, dt2:i&amp;lt;&amp;lt; get name),
contains(dt2:i&amp;lt;&amp;lt; get name, "YYY") &amp;gt; 0, insert into(Ylist, dt2:i&amp;lt;&amp;lt; get name),
)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to create a new column as below which will give me a sum of the Xcolumn and Ycolumn. It is not working well for me at all. I must not be doing something right.... Please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt2 &amp;lt;&amp;lt; New Column( "Xsum", Numeric, Continuous, Format( "Best", 12 ),
Formula(
sum(eval(Xlist)),
)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 17 Jul 2018 19:32:27 GMT</pubDate>
    <dc:creator>nguyendv06</dc:creator>
    <dc:date>2018-07-17T19:32:27Z</dc:date>
    <item>
      <title>how to get a sum of all columns with names stored in a list</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-get-a-sum-of-all-columns-with-names-stored-in-a-list/m-p/63140#M33911</link>
      <description>&lt;P&gt;I have create a list of column containing roughly the same name below:&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;Xlist = {};
Ylist = {};
for(i = 1, i &amp;lt; ncols(dt2), i++,
if(
contains(dt2:i&amp;lt;&amp;lt; get name, "XXX") &amp;gt; 0, insert into(Xlist, dt2:i&amp;lt;&amp;lt; get name),
contains(dt2:i&amp;lt;&amp;lt; get name, "YYY") &amp;gt; 0, insert into(Ylist, dt2:i&amp;lt;&amp;lt; get name),
)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to create a new column as below which will give me a sum of the Xcolumn and Ycolumn. It is not working well for me at all. I must not be doing something right.... Please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt2 &amp;lt;&amp;lt; New Column( "Xsum", Numeric, Continuous, Format( "Best", 12 ),
Formula(
sum(eval(Xlist)),
)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Jul 2018 19:32:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-get-a-sum-of-all-columns-with-names-stored-in-a-list/m-p/63140#M33911</guid>
      <dc:creator>nguyendv06</dc:creator>
      <dc:date>2018-07-17T19:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to get a sum of all columns with names stored in a list</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-get-a-sum-of-all-columns-with-names-stored-in-a-list/m-p/63144#M33914</link>
      <description>&lt;P&gt;This discussion is a duplicate of the discussion item&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Discussions/Adding-up-all-the-columns-with-names-stored-in-a-list/m-p/63125#M33908" target="_self"&gt;Adding up all the columns with names stored in a list&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jul 2018 19:45:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-get-a-sum-of-all-columns-with-names-stored-in-a-list/m-p/63144#M33914</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-07-17T19:45:18Z</dc:date>
    </item>
  </channel>
</rss>

