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.
%3CLINGO-SUB%20id%3D%22lingo-sub-573130%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ESeltsames%20Verhalten%20der%20vom%20Skript%20generierten%20Formelspalte%3B%20Keine%20Daten%2C%20bis%20ich%20die%20Spalte%20in%20dieselbe%20Datentabelle%20kopiere%20und%20einf%C3%BCge%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-573130%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EIch%20habe%20ein%20Skript%2C%20das%20Daten%20aus%20Excel%20l%C3%A4dt%20und%20dann%20eine%20neue%20Formelspalte%20generiert.%20Die%20Spalte%20erscheint%20jedoch%20leer%2C%20obwohl%20in%20meiner%20Formelvorschau%20Werte%20angezeigt%20werden.%20Sobald%20ich%20die%20Spalte%20kopiere%2Fin%20dieselbe%20Datentabelle%20einf%C3%BCge%2C%20erscheinen%20pl%C3%B6tzlich%20die%20Werte.%20Was%20ist%20denn%20hier%20los%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDie%20einfachste%20Demo%20ist%20%C3%BCber%20das%20GIF%20unten.%20Ich%20habe%20auch%20das%20Skript%20und%20die%20Excel-Tabelle%20hinzugef%C3%BCgt.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mvanderaa1_0-1669279319051.gif%22%20style%3D%22width%3A%20634px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22mvanderaa1_0-1669279319051.gif%22%20style%3D%22width%3A%20634px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22mvanderaa1_0-1669279319051.gif%22%20style%3D%22width%3A%20634px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F47594iB05D8A8473B54B97%2Fimage-dimensions%2F634x353%3Fv%3Dv2%22%20width%3D%22634%22%20height%3D%22353%22%20role%3D%22button%22%20title%3D%22mvanderaa1_0-1669279319051.gif%22%20alt%3D%22mvanderaa1_0-1669279319051.gif%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0A%0A%2F%2FPrompt%20to%20select%20and%20open%20an%20MS%20Excel%20file%0Apath%20%3D%20Pick%20File(%20%22Select%20Excel%20File%22%2C%20%22%24DOCUMENTS%22%2C%20%7B%22Excel%20Files%7Ccsv%3Bxlsx%3Bxls%22%2C%20%22All%20Files%7C*%22%7D%2C%201%2C%200%20)%3B%0Afname%20%3D%20Word(%201%2C%20Word(%20-1%2C%20path%2C%20%22%2F%22%20)%2C%20%22.%22%20)%3B%0A%0A%2F%2FLet%20the%20user%20choose%20the%20name%20of%20the%20datatable%0Aw%20%3D%20New%20Window(%20%22Choose%20datatable%20name%22%2C%20%2F%2F%20opens%20a%20window%20with%20a%20title%20and%20this%20content...%0A%20%26lt%3B%3CMODAL%3E%3C%2FMODAL%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-573130%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3EQualit%C3%A4ts-%20und%20Verfahrenstechnik%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-573202%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Seltsames%20Verhalten%20der%20vom%20Skript%20generierten%20Formelspalte%3B%20Keine%20Daten%2C%20bis%20ich%20die%20Spalte%20in%20dieselbe%20Datentabelle%20kopiere%20und%20einf%C3%BCge%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-573202%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EBearbeiten%3A%20Ok%2C%20jetzt%20verstehe%20ich%2C%20ich%20%C3%A4ndere%20den%20Variablennamen%20sp%C3%A4ter%20im%20Skript.%20Daher%20ist%20der%20Verweis%20auf%20den%20Force-Spaltennamen%20zum%20Zeitpunkt%20der%20Erstellung%20der%20Spalte%20nicht%20korrekt.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-573167%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Seltsames%20Verhalten%20der%20vom%20Skript%20generierten%20Formelspalte%3B%20Keine%20Daten%2C%20bis%20ich%20die%20Spalte%20in%20dieselbe%20Datentabelle%20kopiere%20und%20einf%C3%BCge%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-573167%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EAnscheinend%20ist%20der%20Name%20Ihrer%20Force-Spalte%20in%20der%20Formel%20falsch%2C%20bis%20Sie%20sie%20umbenennen.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%0AColumn%20Die%20strength%20Formula%20Interrupted%0AName%20Unresolved%3A%20Force%20at%20row%201%20in%20access%20or%20evaluation%20of%20'Force'%20%2C%20%3AForce%2F*%23%23%23*%2F%0AFormula%20evaluation%20errors%20have%20been%20ignored%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
mvanderaa1
Level IV

Strange behaviour of script generated formula column; no data until I copy+paste the column in the same datatable

I have a script that loads data from excel and then generates a new formula column. The column appears empty however, even though my formula preview shows values. Once I copy/paste the column into the same datatable suddenly the values appear. What's going on here?

 

Easiest demo is through the gif below. I also added the script and excel sheet.

mvanderaa1_0-1669279319051.gif

Names Default To Here( 1 );

//Prompt to select and open an MS Excel file
path = Pick File( "Select Excel File", "$DOCUMENTS", {"Excel Files|csv;xlsx;xls", "All Files|*"}, 1, 0 );
fname = Word( 1, Word( -1, path, "/" ), "." );

//Let the user choose the name of the datatable
w = New Window( "Choose datatable name", // opens a window with a title and this content...
	<<Modal,
	H List Box( Text Box( "Name: " ), tbox = Text Edit Box( fname ) ), // data entry          
	// optionally, close the dialog. Or, you might want to run it again...
	H List Box(
		Button Box( "OK",
			fname = tbox << get text(); // data entry                            
			Button Box( "Cancel" );
		)
	)
);
dt = Open( path );

//Extract the die strength measurement conditions from the datatable and move to table variables
dt << Set Name( fname );
tableVariables = {"Thickness (um)", "Width (mm)", "L (mm)"};
For Each( {var, index}, tableVariables,
	dt << Set Table Variable( var, As Column( var )[1] );
	dt << delete column( Column( var ) );
);

col_name_list = dt << get column names( string );

// Check if the die strength column exists, otherwise calculate from the force and measurement conditions
If( !Contains( col_name_list, "Die strength (MPa)" ),
dt << New Column( "Die strength", Numeric,
		"Continuous",
		Formula( 3 * :Force * :"L (mm)"n / ((:"Thickness (um)"n * 0.001) ^ 2 * 2 * :"Width (mm)"n) )
		 ),
dt:"Die strength (MPa)"n << Set Name( "Die strength" );
);

//Rename the Die strength and force columns and set their respective units
dt:"Die strength"n << Set Property( "Units", "MPa" );
dt:"Force (N)"n << Set Property( "Units", "N" );
dt:"Force (N)"n << Set Name( "Force" );

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Strange behaviour of script generated formula column; no data until I copy+paste the column in the same datatable

It seems like your force column's name is wrong in the formula until you rename it.

 


Column Die strength Formula Interrupted
Name Unresolved: Force at row 1 in access or evaluation of 'Force' , :Force/*###*/
Formula evaluation errors have been ignored
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Strange behaviour of script generated formula column; no data until I copy+paste the column in the same datatable

It seems like your force column's name is wrong in the formula until you rename it.

 


Column Die strength Formula Interrupted
Name Unresolved: Force at row 1 in access or evaluation of 'Force' , :Force/*###*/
Formula evaluation errors have been ignored
-Jarmo
mvanderaa1
Level IV

Re: Strange behaviour of script generated formula column; no data until I copy+paste the column in the same datatable

Edit: Ok I see now, I'm changing the variable name later in the script. So the Force column name reference is not correct at the time of creating the column.

Recommended Articles