<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to use get selected values from a combo box inside another expression on a different jsl script? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-use-get-selected-values-from-a-combo-box-inside-another/m-p/428123#M67747</link>
    <description>&lt;P&gt;Thank you. This worked. The variables were getting overlapped.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Oct 2021 07:43:58 GMT</pubDate>
    <dc:creator>ankitgssingh</dc:creator>
    <dc:date>2021-10-19T07:43:58Z</dc:date>
    <item>
      <title>How to use get selected values from a combo box inside another expression on a different jsl script?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-get-selected-values-from-a-combo-box-inside-another/m-p/427090#M67677</link>
      <description>&lt;P&gt;Hello All,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have 2 scripts. ScriptA has an expression to build a bivariate chart with dynamic limits. ScriptB is basically an front end application code which asks users to select the x-axis and y-axis column names. I want to use the selected inputs from the users from ScriptB&amp;nbsp; (i.e. get selected from a combo box) into my ScriptA expression code for getting the bivariate chart as an output for the selected columns.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;MY AIM IS TO GET THE GRAPH WITH SLIDERS FOR THE SELECTED PARAMETERS WHEN I RUN SCRIPT B !!&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;/////////////////////////////////SCRIPT B///////////////////////////////////////////////////
include("ScriptA");

myStaticLibContainer = vListBox();          //Making a static container



//////Calling the expression "myFinalDisplay" from ScriptA and adding it to the static container//////

sliderGraph = buttonBox("Get Slider Graph", myStaticLibContainer &amp;lt;&amp;lt; append(vListBox(myFinalDisplay)));



///Creating user input boxes///

inputParameter = comboBox("Parameter");
response = comboBox("Response");
blocking = comboBox("FAB");

myMainToolPanelBox = panelBox("myMainToolPanelBox",
	vListBox(
		spacerBox(size(1000,0)),
		V List Box(Text Box("Predictor"), inputParameter),
		V List Box(Text Box("Response"), response),
		V List Box(Text Box("Block By"), blocking)),
		H List Box(sliderGraph), 
		scrollBox(size(1000,550), myStaticLibContainer),
	);


myPlatform = newWindow("Loss Curves", myMainToolPanelBox);	  

/////////////////////////////////SCRIPT B  ENDS///////////////////////////////////////////////////&lt;/CODE&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;////////////////////////////////////SCRIPT A//////////////////////////////////////

DT = open("data.jmp", invisible);


//Getting the inputs
x = inputParameter  &amp;lt;&amp;lt; get Selected;
y = response &amp;lt;&amp;lt; get Selected;
z = blocking &amp;lt;&amp;lt; get Selected;

//Making graphs		

myFinalDisplay = expr(
	myGbDispObj = dt &amp;lt;&amp;lt; Bivariate(
	Size( 550, 400 ),
	Y( Eval(y) ),
	X( Eval(x) ),
	Automatic Recalc( 1 ),
	Histogram Borders( 1 ),
	Summary Statistics( 1 ),
	Fit Spline( 2, {Line Color( {212, 73, 88} )} ),
	SendToReport(	
		Dispatch(
			{},
			"Bivar Plot",
			FrameBox,
			{Row Legend(
				Eval(z),
				Color( 1 ),
				Color Theme( "JMP Default" ),
				Marker( 1 ),
				Marker Theme( "Solid" ),
				Continuous Scale( 1 ),
				Reverse Scale( 0 ),
				Excluded Rows( 0 )
			)}
		),
		Dispatch( {}, "Summary Statistics", OutlineBox, {Close( 1 )} )
	)
);

	myLimitCol = column(DT, Eval(x));
	
	myLimitMin = colMinimum(myLimitCol); show(myLimitMin);
	myLimitMax = colMaximum(myLimitCol); show(myLimitMax);
	myTbLo = textBox(Char(round(myLimitMin, 2)) || " (OOC = " || char(0.00, 10, 2) || "%)");
	myTbHi = textBox(Char(round(myLimitMax, 2)) || " (OOC = " || char(0.00, 10, 2) || "%)");

	mySbDispObj = rangeSliderBox(
		myLimitMin,
		myLimitMax,
		32,
		36,
					
		//script
		mySelectedLower = mySbDispObj &amp;lt;&amp;lt; getLower;
		mySelectedUpper = mySbDispObj &amp;lt;&amp;lt; getUpper;
		myGbDispObj &amp;lt;&amp;lt; Dispatch( {}, "1", ScaleBox, {Add Ref Line( mySelectedLower, "Dashed", "blue", "LCL", 4 )} );
		myGbDispObj &amp;lt;&amp;lt; Dispatch( {}, "1", ScaleBox, {Add Ref Line( mySelectedUpper, "Dashed", "blue", "UCL", 4 )} );
		
		rUpper = dt &amp;lt;&amp;lt; Get Rows Where( myLimitCol[] &amp;gt; mySelectedUpper );
		OOC_valUpper = (N Items(rUpper) / N rows(dt))*100;
		myTbHi &amp;lt;&amp;lt; setText(Char(round(mySelectedUpper, 1)) || " (OOC = " || char(OOC_valUpper, 10, 2) || "%)");

		rLower = dt &amp;lt;&amp;lt; Get Rows Where( myLimitCol[] &amp;lt; mySelectedLower );
		OOC_valLower = (N Items(rLower) / N rows(dt))*100;
		myTbLo &amp;lt;&amp;lt; setText(Char(round(mySelectedLower, 1)) || " (OOC = " || char(OOC_valLower, 10, 2) || "%)");
	);
	mySbDispObj &amp;lt;&amp;lt; Set Width( 275 );
		
	myLayout = vListBox(
		myGbDispObj,
		hListBox(myTbLo, spacerBox(size(50,0)), myTbHi),
		mySbDispObj
	);
);



//PLATFORM = newWindow("TEST", vListBox(myFinalDisplay));



////////////////////////////////////SCRIPT A    ENDS//////////////////////////////////////&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;/////////////////////////////////////////SCRIPT A ENDS///////////////////////////////////////&lt;/P&gt;
&lt;P&gt;I have also attached the data table and scripts !!&lt;/P&gt;
&lt;P&gt;Thank you in advance.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;@&lt;A href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4550" target="_blank" rel="noopener"&gt;pmroz&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:18:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-get-selected-values-from-a-combo-box-inside-another/m-p/427090#M67677</guid>
      <dc:creator>ankitgssingh</dc:creator>
      <dc:date>2023-06-11T11:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to use get selected values from a combo box inside another expression on a different jsl script?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-get-selected-values-from-a-combo-box-inside-another/m-p/427382#M67694</link>
      <description>&lt;P&gt;I made some modifications to your Script A.&amp;nbsp; Basically, the changes were to ensure that variables that are being called have been defined prior to the calling of them.&amp;nbsp; I added the Clear Symbols(); which helps with making sure the variables are not hanging around.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
Clear Symbols();
DT = open("data.jmp", invisible);

//Making graphs		

myFinalDisplay = Expr(
//Getting the inputs
	x = inputParameter &amp;lt;&amp;lt; get Selected;
	y = response &amp;lt;&amp;lt; get Selected;
	z = blocking &amp;lt;&amp;lt; get Selected;
	myGbDispObj = dt &amp;lt;&amp;lt; Bivariate(
		Size( 550, 400 ),
		Y( Eval( y ) ),
		X( Eval( x ) ),
		Automatic Recalc( 1 ),
		Histogram Borders( 1 ),
		Summary Statistics( 1 ),
		Fit Spline( 2, {Line Color( {212, 73, 88} )} ),
		SendToReport(
			Dispatch(
				{},
				"Bivar Plot",
				FrameBox,
				{Row Legend(
					Eval( z ),
					Color( 1 ),
					Color Theme( "JMP Default" ),
					Marker( 1 ),
					Marker Theme( "Solid" ),
					Continuous Scale( 1 ),
					Reverse Scale( 0 ),
					Excluded Rows( 0 )
				)}
			),
			Dispatch( {}, "Summary Statistics", OutlineBox, {Close( 1 )} )
		)
	);

	myLimitCol = Column( DT, Eval( x ) );
	
	myLimitMin = Col Minimum( myLimitCol );
	Show( myLimitMin );
	myLimitMax = Col Maximum( myLimitCol );
	Show( myLimitMax );
	myTbLo = Text Box( Char( Round( myLimitMin, 2 ) ) || " (OOC = " || Char( 0.00, 10, 2 ) || "%)" );
	myTbHi = Text Box( Char( Round( myLimitMax, 2 ) ) || " (OOC = " || Char( 0.00, 10, 2 ) || "%)" );

	mySbDispObj = Range Slider Box(
		myLimitMin,
		myLimitMax,
		mySelectedLower,
		mySelectedUpper, 
					
		//script
		//mySelectedLower = mySbDispObj &amp;lt;&amp;lt; getLower;
		//mySelectedUpper = mySbDispObj &amp;lt;&amp;lt; getUpper;
		myGbDispObj &amp;lt;&amp;lt; Dispatch( {}, "1", ScaleBox, {Add Ref Line( mySelectedLower, "Dashed", "blue", "LCL", 4 )} );
		myGbDispObj &amp;lt;&amp;lt; Dispatch( {}, "1", ScaleBox, {Add Ref Line( mySelectedUpper, "Dashed", "blue", "UCL", 4 )} );
		
		rUpper = dt &amp;lt;&amp;lt; Get Rows Where( myLimitCol[] &amp;gt; mySelectedUpper );
		OOC_valUpper = (N Items( rUpper ) / N Rows( dt )) * 100;
		myTbHi &amp;lt;&amp;lt; setText( Char( Round( mySelectedUpper, 1 ) ) || " (OOC = " || Char( OOC_valUpper, 10, 2 ) || "%)" );

		rLower = dt &amp;lt;&amp;lt; Get Rows Where( myLimitCol[] &amp;lt; mySelectedLower );
		OOC_valLower = (N Items( rLower ) / N Rows( dt )) * 100;
		myTbLo &amp;lt;&amp;lt; setText( Char( Round( mySelectedLower, 1 ) ) || " (OOC = " || Char( OOC_valLower, 10, 2 ) || "%)" );
	);
	mySbDispObj &amp;lt;&amp;lt; Set Width( 275 );
		
	myLayout = V List Box( myGbDispObj, H List Box( myTbLo, Spacer Box( size( 50, 0 ) ), myTbHi ), mySbDispObj );
);



//PLATFORM = newWindow("TEST", vListBox(myFinalDisplay));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The only change to Script B was to add scoping clarification to the "response" variable.&amp;nbsp; You are using it in the script and it is also a column name.&amp;nbsp; JMP was getting confused.&amp;nbsp; So by adding "::" in front of it, it forced JMP to look for a memory variable, not a column for it's usage&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
myStaticLibContainer = vListBox();&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Making a static container



//////Calling the expression "myFinalDisplay" from ScriptA and adding it to the static container//////

sliderGraph = buttonBox("Get Slider Graph", myStaticLibContainer &amp;lt;&amp;lt; append(vListBox(myFinalDisplay)));



///Creating user input boxes///

inputParameter = comboBox("Parameter");
::response = comboBox("Response");
blocking = comboBox("FAB");

myMainToolPanelBox = panelBox("myMainToolPanelBox",
	vListBox(
		spacerBox(size(1000,0)),
		V List Box(Text Box("Predictor"), inputParameter),
		V List Box(Text Box("Response"), response),
		V List Box(Text Box("Block By"), blocking)),
		H List Box(sliderGraph), 
		scrollBox(size(1000,550), myStaticLibContainer),
	);


myPlatform = newWindow("Loss Curves", myMainToolPanelBox);	  
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 16 Oct 2021 17:46:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-get-selected-values-from-a-combo-box-inside-another/m-p/427382#M67694</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-10-16T17:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to use get selected values from a combo box inside another expression on a different jsl script?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-get-selected-values-from-a-combo-box-inside-another/m-p/428123#M67747</link>
      <description>&lt;P&gt;Thank you. This worked. The variables were getting overlapped.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 07:43:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-get-selected-values-from-a-combo-box-inside-another/m-p/428123#M67747</guid>
      <dc:creator>ankitgssingh</dc:creator>
      <dc:date>2021-10-19T07:43:58Z</dc:date>
    </item>
  </channel>
</rss>

