Wie verwende ich ausgewählte Werte aus einem Kombinationsfeld in einem anderen Ausdruck in einem anderen JSL-Skript?Hallo alle,
Ich habe 2 Skripte. ScriptA hat einen Ausdruck zum Erstellen eines bivariaten Diagramms mit dynamischen Grenzen. ScriptB ist im Grunde ein Front-End-Anwendungscode, der Benutzer auffordert, die Spaltennamen der x- und y-Achse auszuwählen. Ich möchte die ausgewählten Eingaben von den Benutzern von ScriptB (dh aus einem Kombinationsfeld ausgewählt) in meinen ScriptA-Ausdruckscode verwenden, um das bivariate Diagramm als Ausgabe für die ausgewählten Spalten zu erhalten.
MEIN ZIEL IST, DAS GRAPH MIT SCHIEBERN FÜR DIE AUSGEWÄHLTEN PARAMETER ZU ERHALTEN, WENN ICH SKRIPT B AUSFÜHRE !!
/////////////////////////////////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 << 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///////////////////////////////////////////////////
////////////////////////////////////SCRIPT A//////////////////////////////////////
DT = open("data.jmp", invisible);
//Getting the inputs
x = inputParameter << get Selected;
y = response << get Selected;
z = blocking << get Selected;
//Making graphs
myFinalDisplay = expr(
myGbDispObj = dt << 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 << getLower;
mySelectedUpper = mySbDispObj << getUpper;
myGbDispObj << Dispatch( {}, "1", ScaleBox, {Add Ref Line( mySelectedLower, "Dashed", "blue", "LCL", 4 )} );
myGbDispObj << Dispatch( {}, "1", ScaleBox, {Add Ref Line( mySelectedUpper, "Dashed", "blue", "UCL", 4 )} );
rUpper = dt << Get Rows Where( myLimitCol[] > mySelectedUpper );
OOC_valUpper = (N Items(rUpper) / N rows(dt))*100;
myTbHi << setText(Char(round(mySelectedUpper, 1)) || " (OOC = " || char(OOC_valUpper, 10, 2) || "%)");
rLower = dt << Get Rows Where( myLimitCol[] < mySelectedLower );
OOC_valLower = (N Items(rLower) / N rows(dt))*100;
myTbLo << setText(Char(round(mySelectedLower, 1)) || " (OOC = " || char(OOC_valLower, 10, 2) || "%)");
);
mySbDispObj << Set Width( 275 );
myLayout = vListBox(
myGbDispObj,
hListBox(myTbLo, spacerBox(size(50,0)), myTbHi),
mySbDispObj
);
);
//PLATFORM = newWindow("TEST", vListBox(myFinalDisplay));
////////////////////////////////////SCRIPT A ENDS//////////////////////////////////////
////////////////////////////////////////SKRIPT A ENDE////// /////////////////////////////////
Ich habe auch die Datentabelle und die Skripte angehängt !!
Vielen Dank im Voraus.
@txnelson
pmroz
DatentabelleGrafikRe: Wie verwende ich ausgewählte Werte aus einem Kombinationsfeld in einem anderen Ausdruck in einem anderen JSL-Skript?Ich habe einige Änderungen an Ihrem Skript A vorgenommen. Im Wesentlichen sollten die Änderungen sicherstellen, dass die aufgerufenen Variablen vor dem Aufrufen definiert wurden.Ich habe die Clear Symbols () hinzugefügt; Dies hilft dabei, sicherzustellen, dass die Variablen nicht herumhängen.
Clear Symbols();
DT = open("data.jmp", invisible);
//Making graphs
myFinalDisplay = Expr(
//Getting the inputs
x = inputParameter << get Selected;
y = response << get Selected;
z = blocking << get Selected;
myGbDispObj = dt << 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 << getLower;
//mySelectedUpper = mySbDispObj << getUpper;
myGbDispObj << Dispatch( {}, "1", ScaleBox, {Add Ref Line( mySelectedLower, "Dashed", "blue", "LCL", 4 )} );
myGbDispObj << Dispatch( {}, "1", ScaleBox, {Add Ref Line( mySelectedUpper, "Dashed", "blue", "UCL", 4 )} );
rUpper = dt << Get Rows Where( myLimitCol[] > mySelectedUpper );
OOC_valUpper = (N Items( rUpper ) / N Rows( dt )) * 100;
myTbHi << setText( Char( Round( mySelectedUpper, 1 ) ) || " (OOC = " || Char( OOC_valUpper, 10, 2 ) || "%)" );
rLower = dt << Get Rows Where( myLimitCol[] < mySelectedLower );
OOC_valLower = (N Items( rLower ) / N Rows( dt )) * 100;
myTbLo << setText( Char( Round( mySelectedLower, 1 ) ) || " (OOC = " || Char( OOC_valLower, 10, 2 ) || "%)" );
);
mySbDispObj << Set Width( 275 );
myLayout = V List Box( myGbDispObj, H List Box( myTbLo, Spacer Box( size( 50, 0 ) ), myTbHi ), mySbDispObj );
);
//PLATFORM = newWindow("TEST", vListBox(myFinalDisplay));
Die einzige Änderung an Skript B bestand darin, der Variablen "Antwort" eine Bereichsklärung hinzuzufügen.Sie verwenden es im Skript und es ist auch ein Spaltenname.JMP wurde verwirrt.Durch das Hinzufügen von "::" davor wurde JMP gezwungen, nach einer Speichervariablen und nicht nach einer Spalte für ihre Verwendung zu suchen
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 << 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);
Re: Wie verwende ich ausgewählte Werte aus einem Kombinationsfeld in einem anderen Ausdruck in einem anderen JSL-Skript?Dankeschön. Das hat funktioniert. Die Variablen überlappten sich.