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

How to save the benchmarks window to the data table ?

Hi ! 

 

Thanks to this script I generate à window of BenchMarks on jmp and I would like to save it to the data table ( like if I was doing "save script to data table") The problem is that the end of my script doesn't work !! 

// Ouvrir la table de données
dt = Open(fichier1);

// Initialiser une liste pour stocker les noms des colonnes avec la note "INGOT CHARACTERISTICS"
cols_with_note = {};

// Parcourir chaque colonne de la table par index
For(i = 1, i <= N Cols(dt), i++,
	col = Column(dt, i);
// Vérifier si la colonne a une note "INGOT CHARACTERISTICS"
	If(col << Get Property("Notes") == "INGOT CHARACTERISTICS", 
// Ajouter le nom de la colonne à la liste
		Insert Into(cols_with_note, col << Get Name)
	);
);

Print(
	"Colonnes avec notes trouvées pour la famille " || "INGOT CHARACTERISTICS" || " : " ||
	Char(cols_with_note) || "\n"
);

// Créer une nouvelle fenêtre pour regrouper tous les graphiques
report_window = New Window("BenchMarks_Ingot_Characteristics",
	V List Box(
		Fit Group(
			For(i = 1, i <= N Items(cols_with_note), i++,
				col_name = cols_with_note[i];
// Ajouter le graphique Oneway au Fit Group
				Oneway(
					Y(Column(dt, col_name)),
					X(Column(dt, selection)),
					Quantiles(1),
					Means and Std Dev(1),
					Box Plots(1),
					Mean Error Bars(1),
					Std Dev Lines(1),
					X Axis Proportional(0),
					Grand Mean(0),
					SendToReport(
						Dispatch({}, "Oneway Plot", FrameBox,
							{DispatchSeg(
								Box Plot Seg(1),
								{Confidence Diamond(0), Shortest Half Bracket(0),
								Line Color("Red")}
							)}
						)
					)
				);
			)
		)
	)
);
// Enregistrer la fenêtre dans le fichier de données
report_window << Save Script to Data Table(
	dt, // Spécifie la table de données
	"BenchMarks_Ingot_Characteristics", // Nom de la fenêtre pour enregistrer

);

Edit 2024-08-12 jthi, Added JSL formatting

18 REPLIES 18
jthi
Super User

Re: How to save the benchmarks window to the data table ?

When you post JSL code to JMP Community, please utilize JSL formatting. You can add it with
jthi_0-1723476660559.png.

 

On your question, which JMP version are you using?

-Jarmo
jthi
Super User

Re: How to save the benchmarks window to the data table ?

Here are two options which might work for you. Option 2 is usually easier to use but the script it creates is more difficult to modify in the table

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");

sel = "SITE";

cols = Left(dt << Get Column Names("Continuous", "String"), 10);


// Option1
ow_expr = EvalExpr(dt << Oneway(
	Y(Eval(Expr(cols))),
	X(Eval(Expr(sel))),
	Quantiles(1),
	Means and Std Dev(1),
	Box Plots(1),
	Mean Error Bars(1),
	Std Dev Lines(1),
	X Axis Proportional(0),
	Grand Mean(0),
	SendToReport(
		Dispatch({}, "Oneway Plot", FrameBox,
			{DispatchSeg(
				Box Plot Seg(1),
				{Confidence Diamond(0), Shortest Half Bracket(0),
				Line Color("Red")}
			)}
		)
	)
));

Eval(EvalExpr(
	dt << New Script("Plots", Expr(Name Expr(ow_expr)));
));
dt << Run Script("Plots"); // if you want to leave it open



// Option2
ows = dt << Oneway(
	Y(Eval(cols)),
	X(Eval(sel)),
	Quantiles(1),
	Means and Std Dev(1),
	Box Plots(1),
	Mean Error Bars(1),
	Std Dev Lines(1),
	X Axis Proportional(0),
	Grand Mean(0),
	SendToReport(
		Dispatch({}, "Oneway Plot", FrameBox,
			{DispatchSeg(
				Box Plot Seg(1),
				{Confidence Diamond(0), Shortest Half Bracket(0),
				Line Color("Red")}
			)}
		)
	)
);

ows[1] << Save Script for All Objects To Data Table("Plot2");
-Jarmo

Re: How to save the benchmarks window to the data table ?

I made a loop to have all my benchmarks in one Fit Group and I would like to save all this Fit Group in one window, the script you sent me did not works for me

jthi
Super User

Re: How to save the benchmarks window to the data table ?

What is wrong with the script I provided you with? You didn't tell me which JMP version you are using so that might not work for all JMP version (I have only access top JMP17 and JMP18).

-Jarmo

Re: How to save the benchmarks window to the data table ?

It didn’t register the benchmarks in my fichier1 don’t know why

Re: How to save the benchmarks window to the data table ?

I use jmp 16
txnelson
Super User

Re: How to save the benchmarks window to the data table ?

Jarmo,

I ran your script in JMP 16 and both options worked as expected, saving the scripts to the original data table.

 

 

Jim

Re: How to save the benchmarks window to the data table ?

Moreover the script you send me doesn’t incluse the loop
jthi
Super User

Re: How to save the benchmarks window to the data table ?

If loop isn't necessary (might be with JMP16) why would you use one? For with my previous scripts you get results like this (in JMP18)

jthi_0-1723567187515.png

 

-Jarmo