Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
vince_faller
Super User

Force which data table a report is nested under.

So I'm trying to change which data table a new window() report is nested under and it just seems that it's based on which data table is used first in a report.  Is there a way to force this nesting?

 

Names default to here(1);
dt = open("$SAMPLE_DATA\Big Class.jmp");
dt << Bivariate(Y(:height), X(:weight));

dt_sum = dt << Summary(
	Group( :age ),
	Mean( :height ),
	Mean( :weight ),
	Freq( "None" ),
	Weight( "None" )
);

//This will nest under dt_sum
new window("Summary First", 
	dt_sum << Distribution( Continuous Distribution( Column( :Name( "Mean(height)" ) ) ) ),
	dt << Bivariate(Y(:height), X(:weight)), 
);

//This will nest under dt
new window("Main First", 
	dt << Bivariate(Y(:height), X(:weight)), 
	dt_sum << Distribution( Continuous Distribution( Column( :Name( "Mean(height)" ) ) ) ),
);
Vince Faller - Predictum
2 REPLIES 2
Highlighted

Re: Force which data table a report is nested under.

I don't know whether there is a natural way to do this, but here is a workaround: start with a (computationally cheap, optimally) report from the table under which you want the new table nested, then delete this report if needed:

 

See the change in the last block of code, copied from yours:

 

//This will nest under dt_sum
new window("Summary First", 
	dt_sum << Distribution( Continuous Distribution( Column( :Name( "Mean(height)" ) ) ) ),
	dt << Bivariate(Y(:height), X(:weight)), 
);

//This will now also nest under dt_sum
new window("Main First", 
	dist1 = dt_sum << Distribution( Continuous Distribution( Column( :Name( "Mean(height)" ) ) ) ),
	dt << Bivariate(Y(:height), X(:weight)), 
	dt_sum << Distribution( Continuous Distribution( Column( :Name( "Mean(height)" ) ) ) ),
);
dist1 << delete
Highlighted

Re: Force which data table a report is nested under.

Another way would be to use the sib prepend message--but oddly, I'm needing the wait() statement to pull that off. Try it with, and without, the wait() to see what I mean.

//This will now also nest under dt_sum
nw = new window("Main First", 
	rep1 = 	dt_sum << Distribution( Continuous Distribution( Column( :Name( "Mean(height)" ) ) ) ),
);

wait();

rep1 << Sib Prepend(
	dt << Bivariate(Y(:height), X(:weight))
);
Article Labels

    There are no labels assigned to this post.