cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

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

How to add columns with empty data

I have a table similar to this:

 xyz xyzxyz
aa12  .3
bb    ..
cc2 3 .5

The columns have rows containing both numeric and empty data.

I want to create a new column (xyz) where I add the data in column x, y and z.

In other words, I want the result to look like the green xyz-column.

 

The problem is, when I run my script, I get the result in the red xyz-column..

How do I add columns with empty data?

 

I use the following script to create the xyz-column:

dt << New Column("xyz",

         Numeric,

         Formula(:Name("x")+:Name("y")+:Name("z")

         )

         );

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How to add columns with empty data

Use:

dt << New Column( "xyz", Numeric, Formula( Sum( :x, :y,:z ) ) );

 The Sum() function ignores missing values.

Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: How to add columns with empty data

Use:

dt << New Column( "xyz", Numeric, Formula( Sum( :x, :y,:z ) ) );

 The Sum() function ignores missing values.

Jim

Re: How to add columns with empty data

Thank you, it works :)

Recommended Articles