cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
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

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

I don’t get how loop isn’t necessary when I need to generate benchmarks for each values of the list cols_with_note as Y
jthi
Super User

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

Some JMP platforms let you use multiple columns as inputs. After you have your list of columns, you might just be able to directly use it as an input in a platform. So you need one loop to collect columns (or some other method, I don't have your data so I cannot know) and second loop might be unnecessary depending on the final result you wish to have.

 

My example doesn't have any loops, because it is unnecessary for my example script to loop over any columns to create an example list. I can just pick some columns to demonstrate what you can do, especially as you seem to have already solved the column collection part.

-Jarmo

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

Okay I get it but I don't know why when I click on the button to lauch it it doesnt work ? So know it did save it but I can't launch the benchmarks from the green button

jthi
Super User

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

Right click on the script and select Edit

jthi_0-1723571386633.png

You can then view the script which is in the table, most likely there is something wrong with it. Sometimes it can be a bit difficult to get them saved correctly to data table.

-Jarmo

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

Ok ty very much, you really saved me !! I have another question, I'm making this for several study and sometimes the list cols (or cols_with_note) might be empty but the script you send me doesn't work if cols is empty (which is normal actually) I'm making this script to add them to a workflow form jump. Is there any way to say like "if cols is empty then stop the script and pass to the next one" ?

 

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

or rather an if the list is not empty we generate the benchmarks and otherwise we do nothing

jthi
Super User

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

You can use if statement and N Items() to check if list has any items. And then either stop if it is empty or do something else

mylist = {};
If(N Items(mylist) == 0,
	stop();
);
show(1);
-Jarmo
txnelson
Super User

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

I strongly suggest that you take the time to read the Scripting Guide available under the Help pull down menu.  

Jim

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

I have noticed that when my list contain only one column name or column that are empty the script say : send expects scriptable objects how to correct this ??