cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
SpannerHead
Level IV

Add values above a particular value to Missing Value Codes

I looked through the forum and I didn't see this posted.  I want to add all values in a data table that are greater than a particular value to be included as missing value codes.  The approach I was thinking of was to iteratively define all those values in a list and then add that list to the iteration like this.

 

Column( dt, colNames[i] ) << set property ("Missing Value Codes", {999, -999, 1e+13, 1.5e13, 2e+13, 3e+13, 4e+13, 5e+13, 6e+13, 1e+30, 2e+30, 3e+30, -5.5e+29, 9e+33});

 

Anyone figure this out?  If not, I'll work something out and post that. 


Slán



SpannerHead
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Add values above a particular value to Missing Value Codes

Until we get this, you have to use something like you have described

Allow using limits in Missing Value Codes or provide new column property with same functionality 

Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

limit = 55;
m = dt[0, "height"];
high_rows = Loc(m > 55);

Column(dt, "height") << Set Property("Missing Value Codes", As List(m[high_rows]));

Write();
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Add values above a particular value to Missing Value Codes

Until we get this, you have to use something like you have described

Allow using limits in Missing Value Codes or provide new column property with same functionality 

Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

limit = 55;
m = dt[0, "height"];
high_rows = Loc(m > 55);

Column(dt, "height") << Set Property("Missing Value Codes", As List(m[high_rows]));

Write();
-Jarmo
SpannerHead
Level IV

Re: Add values above a particular value to Missing Value Codes

Added an iterative loop and off to the races.
Names Default To Here(1); 

dt = Current Data Table();

colnames = dt << get column names( numeric,string );
meanlist = {};
For( i = 1, i <= N Items( colnames ), i++,	
m = dt[0, colnames[i]];
high_rows = Loc(m > 30);

column(dt,colnames[i]) << Set Property("Missing Value Codes", As List(m[high_rows]));

Write();
	
);

 


Slán



SpannerHead