cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
kachveder
Level III

How to Minimize data tables or put Data tables into a Tab Box, with the data tables created in a for loop

Hi, 

 

I am having some trouble with the following. I have a group of custom output, grouped by a variable, that I need to be in a single report. I get the output that I need. However, I get so many subset data tables as a result of the for loop. I was reading about tab windows, but there is not much written online about putting multiple data tables into tabs. Is there such an option?

 

If not, then perhaps I can add an option to my JMP script that automatically minimizes the data tables being generated with the report.  

 

If there is no such option mentioned above, would there be a way to use only the select where statement to select the rows of the data and then use those rows to generate custom and automatic output into a single report? I tried to use this forum's methodology, but I wasn't getting any results. 

 

Here is my current JMP script, along with the jmp file attached. 

 

Names Default To Here( 1 );
dt = Current Data Table();

col9 = Column(dt, "category");
unique_category = Associative Array(col9) << get keys;

nw= New Window("results",
    container = V List Box()
);

for (i = 1, i <= N Items(unique_category), i++,
	content = V List Box(
	vali = unique_category[i];
	dt << Select Where(:category == vali);
	
	//subset the selected data
	listDT = dt << Subset(
		output table name( "Subset where category is " || vali ),
		Selected rows only ( 1 ),
		Selected columns only( 1 )
	);
	
	//Get the measurment units formatted, if applicable
	col4 = Column( listDT, "Measurement Units");
	units = col4[1];
	units_formatted = If(Is Missing(units), "", Is String(units), " (" || units || ") ");
	
	//chart
	Oneway(SendToByGroup( {:category == vali}, 
	Y( :results ) ),
	SendToByGroup(
			{:category == vali},
			X( :name),
			Connect Means( 1 ),
			Grand Mean( 0 )
		), 
			SendToByGroup(
			{:category == vali},
			SendToReport(
				Dispatch(
					{},
					"2",
					ScaleBox,
					{Label Row( Set Font Size( 5 ) )}
				),
				Dispatch(
					{},
					"results",
					TextEditBox,
					{Set Text( vali || units_formatted )}
				),
				Dispatch(
					{},
					"Oneway Plot",
					FrameBox,
					{Frame Size( 1500, 300 ), DispatchSeg(
						CustomStreamSeg( 6 ),
						{Line Color( "Gray" )}
					), Row Legend(
						subcategory,
						Color( 1 ),
						Color Theme( "" ),
						Marker( 0 ),
						Marker Theme( "" ),
						Continuous Scale( 0 ),
						Reverse Scale( 0 ),
						Excluded Rows( 0 )
					)}
				)
			)
		)
	);
	);
	container << Append(content)
);
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How to Minimize data tables or put Data tables into a Tab Box, with the data tables created in a for loop

If you just make your subsetted data tables invisible, you can many times clean up your output.

listDT = dt << Subset( invisible,
		output table name( "Subset where category is " || vali ),
		Selected rows only ( 1 ),
		Selected columns only( 1 )
	);
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: How to Minimize data tables or put Data tables into a Tab Box, with the data tables created in a for loop

If you just make your subsetted data tables invisible, you can many times clean up your output.

listDT = dt << Subset( invisible,
		output table name( "Subset where category is " || vali ),
		Selected rows only ( 1 ),
		Selected columns only( 1 )
	);
Jim
kachveder
Level III

Re: How to Minimize data tables or put Data tables into a Tab Box, with the data tables created in a for loop

Thank you so much, Jim. That's exactly what I needed. 

Recommended Articles