cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
nguyendv06
Level I

how to get a sum of all columns with names stored in a list

I have create a list of column containing roughly the same name below:

 

 

Xlist = {};
Ylist = {};
for(i = 1, i < ncols(dt2), i++,
if(
contains(dt2:i<< get name, "XXX") > 0, insert into(Xlist, dt2:i<< get name),
contains(dt2:i<< get name, "YYY") > 0, insert into(Ylist, dt2:i<< get name),
)
);

 

 

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.

 

dt2 << New Column( "Xsum", Numeric, Continuous, Format( "Best", 12 ),
Formula(
sum(eval(Xlist)),
)
);
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: how to get a sum of all columns with names stored in a list

This discussion is a duplicate of the discussion item

Adding up all the columns with names stored in a list

Jim

View solution in original post

1 REPLY 1
txnelson
Super User

Re: how to get a sum of all columns with names stored in a list

This discussion is a duplicate of the discussion item

Adding up all the columns with names stored in a list

Jim

Recommended Articles