BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
rshehadah
Contributor

JMP Add in

Hi,

 

I created a Add in Tab in JMP. One of my functions is to delete empty cols. However when I run the Add in on one of my tables it does not work. 

 

This is my script:

include("$ADDIN_HOME(com.jmp.jperk.delemptycols)/delemptycols.jsl");
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 )

)

);

 

For some reason it is not deleting empty cols.

 

Am I doing something wrong in the code?

0 Kudos
1 REPLY 1

Re: JMP Add in

A couple of ideas:

 

  1. Testing the ratio against 1 should work but I would use a test of the difference against 0.
  2. The Delete Columns message does not take an integer argument. It requires a column reference, so use Column( 1 ) as the argument instead.
Learn it once, use it forever!