cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

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

Count number of columns which have value

I have a table where I want to create a new column which tells the number of cells in that row which has a value in it. How do I do this?
My columns look like this for example:

Name, A, B, C, D

I need to know how many in A,B,C and D have values in every row. Some rows have values for all of them, and in some none of them have values.
1 ACCEPTED SOLUTION

Accepted Solutions
uday_guntupalli
Level VIII

Re: Count number of columns which have value

@BhargavDS, 
      I am assuming you have a table that looks like this : 

image.png

 

  You can script your new formula like so : 

If( Is Missing( :name ),0,1) + If( Is Missing( :age ), 0, 1 ) +
 If( Is Missing( :sex ), 0, 1 ) + If( Is Missing( :height ),0,1) + 
If( Is Missing( :weight ),0,1)

 

 

Best
Uday

View solution in original post

3 REPLIES 3
uday_guntupalli
Level VIII

Re: Count number of columns which have value

@BhargavDS, 
      I am assuming you have a table that looks like this : 

image.png

 

  You can script your new formula like so : 

If( Is Missing( :name ),0,1) + If( Is Missing( :age ), 0, 1 ) +
 If( Is Missing( :sex ), 0, 1 ) + If( Is Missing( :height ),0,1) + 
If( Is Missing( :weight ),0,1)

 

 

Best
Uday
txnelson
Super User

Re: Count number of columns which have value

The below formula is a simpler form but gives the same results as @uday_guntupall

Sum(:Name == "", isMissing(:age),:sex=="",isMissing(:Height),isMissing(:Weight))

@uday_guntupalli

Jim
Thomas1
Level V

Re: Count number of columns which have value

Did you try the following formula column?

 

N Missing( :A, :B, :C, :D )

Recommended Articles