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.
Delete Empty Columns
robot
Level VI

This JSL script will delete empty data columns.

Comments
fitri

my version as below .

dt = Current Data Table();

For( i = N Col( dt ), i >= 1, i--,

       If( (Col N Missing( Column( i ) ) / N Row()) == 1,

              dt << delete columns( i )

       )

);

Thomas1

Simple and effective. Thanks

Thanks :beaming_face_with_smiling_eyes:

dspa

Piggybacking off @fitri , this worked for me

// get col names
colnames = dt << Get Column Names;

// delete empty columns
For( j = 1, j <= N Items( colnames ), j++,
	If( Col N Missing( Column( colnames[j] ) ) / N Row() == 1,
		dt << delete columns( colnames[j] )
	)
);

Recommended Articles