BookmarkSubscribe
Choose Language Hide Translation Bar
Jax
Jax
Occasional Contributor

Unresolved Column in access or evaluation of 'Send' , As Column...

Hi everyone, nice to meet you! 
I'm a new user in JMP software, and I was tasked to do some assignment regarding on scripting.
I have tried to write a program( I have some parts taken from JMP forums,which I'm really grateful about) ,
what this program does is to generate
1)Drift trend graph ( Y, X and Overlay) 
2)t- test (Y,X)
3)Normal Probability Plot ( Y,X)
Everything works fine if I just select the columns and generate the graph.
However, I have tried to code a "data filter", which saves the current existing selected columns,
so if I ever need to use these preset columns again, I could just load the file and I would not have to select everything all over again. 
Save Button
- Append the selected columns into a List, put it in a data table and save it
Load Button
- upon loading the file, the columns name compared with the names of the data table
- if the names matches, the columns of the original data table would be appended and selected 

The problem arises when I tried to load a preset setting.
I have tried to load the preset setting,/ load the preset settings, remove all the selected columns, and manually select my columns again,
but it still shows the error 

Unresolved Column in access or evaluation of 'Send' , As Column/*###*/()Exception in platform launch in access or evaluation of 'Graph Builder' , Graph Builder(/*###*/Size( 534, 454 ),
	Show Control Panel( 0 ),
	Variables( X( As Column() ), Y( As Column() ), Overlay( As Column() ) ),
	Elements( Points( X, Y, Legend( 12 ) ), Line( X, Y, Legend( 13 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				12,
				Base( 0, 0, 0, Item ID( "0", 1 ) ),
				Base( 1, 0, 0, Item ID( "168", 1 ) ),
				Base( 2, 0, 0, Item ID( "500", 1 ) ),
				Base( 3, 0, 0, Item ID( "1000", 1 ) )
			)}
		)
	)
)

The above is the error that I have encountered. I have tried to search on books and webites but I'm still very stuck. 
I really hope someone could lend a helping hand. Thank you all soso much. 
My assumption is that the method that I used to save the preset setting and retrieveing it is incorrect/ which causes the problem. 

//the data table you want to operate on
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
 
//number of columns in the data table
nc = ncol(dt);
 
//the width of the column list box in pixels
lbWidth = 108;
 
//opens new window called "Clustering" that houses all the function display boxes
clusterDlg = New Window("Clustering",/*uncomment if you want a modal window: <<Modal*/,
       BorderBox(left(3),top(2),
              //V List Boxes organize elements vertically, from top to bottom
              VListBox(
                     TextBox("Finding points that are close, have similar values"),
                     //H List Boxes organize elements horizontally, from left to right
                     HListBox(
                           VListBox(
                                  //Column Selection Box
                                  PanelBox("Select Columns",
                                         colListData=ColListBox(All,width(lbWidth),nLines(min(nc,10)))),
                                  //Options Box
                                  PanelBox("Options",VListBox(
                                                //Dropdown with two choices and defaulted to first choice
                                                comboObj=comboBox({"Drift Trend Graph","t-Test","NPP Plot"},<<Set(1)),
                                                //Radio Box with five choices and defaulted to third choice
                                         )
                                  )
                           ),
                           //Column Select Boxes Y, Ordering, Label, and By and respective action buttons
                           VListBox(
                           
                           PanelBox("Cast Selected Columns into Roles",
                                  LineupBox(NCol(2),Spacing(3),
                                         //Y, Columns Button and Column List Box with 5 lines, type numeric
                                         ButtonBox("Y, Columns", colListY<<Append(colListData<<GetSelected)),
                                         colListY = ColListBox(width(lbWidth),nLines(5),"numeric"),
                                         //Ordering Button and Column List Box with 1 line, type numeric
                                         ButtonBox("X,Ordering", colListX<<Append(colListData<<GetSelected)),
                                         colListX = ColListBox(width(lbWidth),nLines(1)),
                                         ButtonBox("Overlay", colListO<<Append(colListData<<GetSelected)),
                                         colListO = ColListBox(width(lbWidth),nLines(1)),

                                  )
                                  
                           ),
                           PanelBox("Data Filter",
								LineupBox(NCol(2),Spacing(3),
								
								ButtonBox("Browse",
								
									path = Pick File(
									"Select JMP File",
									"", // no default directory
									{"JMP Files|jmp;jsl;jrn", "All Files|*"},
									1,
									0,
									"" // no default file
									);
									If (path != "",
									
										file1 << set text(path)
											
										);
										show(path);
										//dt = open(path,invisible(1));
											
										),
								file1 = Text edit Box("",<< Set Width( 200 ) ),
								Spacer Box(Size(10,1));
								ButtonBox("Load",

									IF(file1 != "",
										Show(file1<<get text);
										dt3 = Open(path);
										for(i=0,i<nc,i++,
										colListX<<setselected(1);
										colListX<<remove selected;
										colListX<<clear selection;
										colListY<<setselected(1);
										colListY<<remove selected;
										colListY<<clear selection;
										colListO<<setselected(1);
										colListO<<remove selected;
										colListO<<clear selection;
										);

										colListA={};
										colListB={};
										colListC={};
										colListA= Column(dt3, "X");
										colListB= Column(dt3, "Y");
										colListC= Column(dt3, "Overlay");


										
										//VARIABLES FOR FILTER APPEND
										ListAitems= Nitems(colListA<<get values);
										ListBitems= Nitems(colListB<<get values);
										ListOitems= Nitems(colListC<<get values);

										// FILTER APPEND Y 
										For(i=1,i<ListBitems+1,i++,
											if(((colListB<<getvalues)[i])!="",
											For(j=1,j<=nc,j++,
											if((colListData<<getitems)[j]==colListB[i],
												colListData<<set selected(j);
												colListY<<Append(colListData<<GetSelected);
												colListData<<Clear Selection;
											),//if
											) //for 
											);
											Print("been here");	
										);
										
										//FILTER APPEND X 
										For(i=1,i<ListAitems+1,i++,
											if(((colListA<<getvalues)[i])!="",
											For(j=1,j<=nc,j++,
											if((colListData<<getitems)[j]==colListA[i],
												colListData<<set selected(j);
												colListX<<Append(colListData<<GetSelected);
												colListData<<Clear Selection;
											),//if
											) //for 
											);

										);
										
										// FILTER APPEND O
										IF (ListOitems != 0,
										For(i=1,i<ListOitems+1,i++,
											if(((colListC<<getvalues)[i])!="",
											For(j=1,j<=nc,j++,
											if((colListData<<getitems)[j]==colListC[i],
												colListData<<set selected(j);
												colListO<<Append(colListData<<GetSelected);
												colListData<<Clear Selection;
											),//if
											) //for 
											);

										);										
										);

									);
									
								);	
								)
                           	
                           	
                           	
                           ),
                           ),
                           //Actions menu
                           PanelBox("Action",
                                  LineupBox(NCol(1),
                                  //OK Button
                                  ButtonBox("OK",

                                         //script that executes upon clicking "OK"
                                         if ((comboObj<<Get)==1,
											Graph Builder(
											Size( 534, 454 ),
											Show Control Panel( 0 ),
											Variables(
											X( :Eval(colListX<<GetItems) ),
											Y( :Eval(colListY<<GetItems) ),
											Overlay( :(colListO<<GetItems) )
											),
											Elements( Points( X, Y, Legend( 12 ) ), Line( X, Y, Legend( 13 ) ) ),
											SendToReport(
											Dispatch(
													{},
													"400",
													ScaleBox,
													{Legend Model(
													12,				
													Base( 0, 0, 0, Item ID( "0", 1 ) ),
													Base( 1, 0, 0, Item ID( "168", 1 ) ),
													Base( 2, 0, 0, Item ID( "500", 1 ) ),
													Base( 3, 0, 0, Item ID( "1000", 1 ) )
													)}
											)
											)
											),

                                              (comboObj<<Get)==2,
                                              
												Oneway(
												Y( :Eval(colListY<<GetItems) ),
												X( :Eval(colListX<<GetItems) ),
												Each Pair(
												1,
												Confidence Quantile( 0 ),
												LSD Threshold Matrix( 0 ),
												Connecting Letters Report( 0 ),
												Detailed Comparisons Report( 1 )
												),
												Means and Std Dev( 0 )
												),
                                              
                                              
                                              (comboObj<<Get)==3,												
												Oneway(
												Y( :Eval(colListY<<GetItems) ),
												X( :Eval(colListX<<GetItems) ),
												All Graphs( 0 ),
												Quantiles( 1 ),
												Means and Std Dev( 1 ),
												Plot Quantile by Actual( 1 ),
												Line of Fit( 0 ),
												Points( 0 ),
												Box Plots( 1 ),
												Mean Error Bars( 1 ),
												Std Dev Lines( 1 )
												), 
												        
                                      
                                         );

                                         clusterDlg<<CloseWindow
                                  ),
                                  //Cancel Button
                                  ButtonBox("Cancel", clusterDlg<<CloseWindow),
                                  TextBox(" "),
                                  //Remove Button
                                  ButtonBox("Remove",
                                         colListY<<RemoveSelected;
                                         colListX<<RemoveSelected;
                                         colListO<<RemoveSelected;
                                         
                                  ),
                                  //Recall and Help not implemented here, buttons are shown in UI
                                  ButtonBox("Recall",notImplemented),
                                  ButtonBox("Help",notImplemented),
                                  ButtonBox("Save",
                                         colListSaveX = Eval(colListX);
                                         colListvalX = colListSaveX<<get items;
                                         colListSaveY = Eval(colListY);
                                         colListvalY = colListSaveY<<get items;
                                         colListSaveO = Eval(colListO);
                                         colListvalO = colListSaveO<<get items;
                                        
                                         newlistX={};
                                         newlistY={};
                                         newlistO={};
                                         
                                         For(i=1,i<=N Items(colListvalX),i++,
											Insert Into(newlistX,colListvalX[i])
                                         );
                                         For(i=1,i<=N Items(colListvalY),i++,
											Insert Into(newlistY,colListvalY[i])
                                         );
                                         For(i=1,i<=N Items(colListvalO),i++,
											Insert Into(newlistO,colListvalO[i])
                                         );
                                  	     dt2= New Table("Preset");
                                         dt2<<New Column("Y",Character,Values(newlistY));
                                         dt2<<New Column("X",Character,Values(newlistX));
                                         dt2<<New Column("Overlay",Character,Values(newlistO));

                                         If( dt2 << Save( "" ),
											Write( "\!nsaved to " || (dt2 << GetPath) ),
											Write( "\!nsave canceled" )
										); // prompt
                                  ))
                           )
                     )
              )
       )
);

 

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Unresolved Column in access or evaluation of 'Send' , As Column...

After a load, your Current Active Data Table is no longer pointing to your measurement data table. You need to make sure your Graph Builder is pointing to your measurment data table, which you use the variable "dt" to point to.  So change line 163 from

Graph Builder(

to

dt << Graph Builder(
Jim
0 Kudos
2 REPLIES 2
txnelson
Super User

Re: Unresolved Column in access or evaluation of 'Send' , As Column...

After a load, your Current Active Data Table is no longer pointing to your measurement data table. You need to make sure your Graph Builder is pointing to your measurment data table, which you use the variable "dt" to point to.  So change line 163 from

Graph Builder(

to

dt << Graph Builder(
Jim
0 Kudos
Jax
Jax
Occasional Contributor

Re: Unresolved Column in access or evaluation of 'Send' , As Column...

@txnelson Thank you so much txnelson! Really really appreciate it. 

0 Kudos