cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
awsmagala
Level II

Issues with local data filter and select where

I am trying to make a Class object that contains methods and properties I find usefull when working with distribution reports.

 

I have everything working how I would like it when I don't try and filter the report or data table but when I try and fitler the report I start having issues.

 

Main issue being is after I filter the report when I go into the display tree to pull and save values they don't reflect the filter.  For example if the column I am analyzing has a mean of 132 before filtering and a mean of 134 after filtering the distirbution report will show 134 for the mean but the display tree will output 132.

 

Make Distribution = Method({filter={}},
			Try(
				Column(dt,col) << Set Name("Data");
				show(NItems(filter)!=0);
				If(
					NItems(filter)!=0,
					dist = dt << Distribution(
						Automatic Recalc( 1 ),
						Continuous Distribution( Column( :Data ),
							Local Data Filter(
								Add Filter(Where(:Data >= filter[0] & :Data<= filter[1]))
							)
						),
					),
					dist = dt << Distribution(Automatic Recalc(1),Continuous Distribution(Column(:Data)));
				);
				rdist = dist << Report;
				show(rdist[1]);
				tmp = rdist["Summary Statistics"][NumberColBox(1)] << Get As Matrix;
				mean = tmp[1];
				stdev = tmp[2];
				std_err_mean = tmp[3];
				up_95_mean = tmp[4];
				low_95_mean = tmp[5];
				N = tmp[6];
				dist_graph = rdist[OutlineBox("Data")][PictureBox(1)];
				Column(dt,"Data") << Set Name(col);
			,
				Throw("Error in Making Distribution: "||char(exception_msg))
			);
		);

Above is the method where I am making the distribution report, adding the local filter, and pulling summary statistic's values from the display tree.

 

I have also tried using a Select Where and Delete Rows routine but the Select Where isn't doing anything when inside the method that method is below.

 

Filter Table = Method({filter},
			dt << Select Where(Column(dt,col)<filter[1] | Column(dt,col)>filter[2]);
			dt << Delete Rows;
);

I am doing this as I fairly often need to get various summary statistics or elements out of distribution reports and this makes it an easy syntax and easy to change.

 

I have attached the full class to this post.

 

Any help would be appreciated.

3 REPLIES 3
uday_guntupalli
Level VIII

Re: Issues with local data filter and select where

@awsmagala
         I would advise introducing a small delay using wait between the construction of the data table after the application of the platform. 

Wait(0.1); 
Best
Uday
awsmagala
Level II

Re: Issues with local data filter and select where

No effect unfortunately.

gzmorgan0
Super User (Alumni)

Re: Issues with local data filter and select where

Hi,

I am responding because I saw a similar behavior in JMP 13.  When I had an attached data filter, I could get and set values to a Column and do Table sorts and table summary manipulations, but got random results with row selection. My work around was to get the column values as vectors (the analysis called for numeric columns) and used loc() functions. Then did my calculations and updated the table values accordingly.

 

JMP Support was notified. I will flag them to look at this blog post because the behavior you described seems to be the same.