I am having trouble inserting a Data Filter Context Box into my script. My script is used to pull in data via SQL, perform some table functions and then spitting out graphs inside of tabbed windows. This makes it visually nicer than what i was doing as every singe output had a new window associated with it and the Test Engineers would have to click on multiple buttons.
I have read these boards as well as reading the scripting guide. The problem i have is how to insert this after the graphs plots and distributions are populated. From the scripting guide.
I tried to use the same philosophy that Mr. txnelson helped me with but I can't get it to create a temp box and then populate after click my buttons. Again, any and all help is appreciated.
d
guide,
// --------------------------- From Scripting Guide -------------------------
dt = Open( "$SAMPLE_DATA/Hollywood Movies.jmp" );
win = New Window( "Shared Local Filter",
Data Filter Context Box(
// enclose the h list box that contains distribution and graph builder
H List Box(
// add the local data filter
// NOTE: My tables aren't created yet so i am getting an error here.
dt << Data Filter( Local ),
dt << Distribution(
Weight( :Profitability ),
Nominal Distribution(
Column( :Lead Studio Name )
),
Nominal Distribution(
Column( :Genre )
),
Histograms Only
),
dt << Graph Builder(
Variables(
X( :Genre ),
Y( :Domestic Gross ),
Y( :Foreign Gross, Position( 1 ) )
),
Show Control Panel( 0 ),
Elements(
Bar( X, Y( 1 ), Y( 2 ),
Legend( 2 ),
Bar Style( "Side by side" ),
Summary Statistic( "Mean" )
),
Frequencies( 0 ),
)
)
)
)
);
// --------------------------- My Data Pull Script Simplified -------------------------
Names Default To Here( 1 );
Close All( Data Tables, No Save );
Close All( Reports );
Clear Log();
Close All( journals, no save );
Clear Symbols();
sqlstartA = Today();
sqlendA = Today();
sqlstart = Format( sqlstartA, "yyyy-mm-dd" );
sqlend = Format( sqlendA, "yyyy-mm-dd" );
/************************************************************************************************************************************************/
/* */
/* ---------------------------------------------------------------[START EXAMPLE] ----------------------------------------------------------- */
/* */
/************************************************************************************************************************************************/
hay = New Window( "Test Database Tools",
V List Box(
V List Box(
Text Box(
"Product Engineering Database Tools",
<<Set Font Size( 20 ),
<<Set Font Style( "Bold" ),
<<Set Min Size( 800, 36 ),
<<Set Max Size( 800, 36 ),
<<Set Width( 1900 ),
<<Set Wrap( 1070 ),
<<Justify Text( "Center" )
),
Spacer Box( Size( 10, 15 ) ),
H List Box(
bb = Border Box( Left( 15 ), Right( 10 ), Top( 10 ), Bottom( 10 ), Sides( 15 ),
V List Box(
lineup1 = Lineup Box( N Col( 1 ),
V List Box(
lineup = Lineup Box( N Col( 1 ),
Text Box( "Select Desired Test Dates", <<Set Font Size( 20 ), <<Justify Text( "Center" ) ),
Spacer Box( Size( 5, 15 ) ),
H Splitter Box(
Border Box( Left( 15 ), Right( 10 ), Top( 10 ), Bottom( 10 ), Sides( 15 ),
StartDate = Calendar Box(
<<Set Function( Function( {f1}, sqlStartA = StartDate << Get Date() ) )
)
),
Border Box( Left( 15 ), Right( 10 ), Top( 10 ), Bottom( 10 ), Sides( 15 ),
EndDate = Calendar Box(
<<Set Function( Function( {f2}, sqlendA = EndDate << Get Date() ) )
)
)
)
)
),
Spacer Box( Size( 5, 5 ) ),
/****************************************************/
/* Selecting Start And End Date Not Required */
/****************************************************/
waferlist = Button Box( "Click Here When Finished",
sqlstart = Format( sqlstartA, "yyyy-mm-dd" );
sqlend = Format( sqlendA, "yyyy-mm-dd" );
Show( sqlstart, sqlend );
lineup1 << Append(
V List Box(
Spacer Box( Size( 5, 5 ) ),
Text Box( "Select Your Wafer(s)", <<Set Font Size( 15 ), <<Justify Text( "Center" ) ),
Spacer Box( Size( 5, 15 ) ),
loaddata = Button Box( "Load The Test Data",
dt = Open( "$SAMPLE_DATA/big class.jmp", invisible );
/****************************************************/
/* Distribution, Graph and Fit Y By X Plots */
/****************************************************/
distr << Delete;
plot << Delete;
fitYbyX << Delete;
distr = V List Box( Distribution( Continuous Distribution( Column( :height ) ) ) );
distrvlb << append( distr );
plot = V List Box(
Graph Builder(
Size( 524, 454 ),
Show Control Panel( 0 ),
Variables( X( :height ), Y( :age ), Overlay( :sex ) ),
Elements( Smoother( X, Y, Legend( 4 ) ) )
)
);
plotvlb << append( plot );
fitYbyX = V List Box( Oneway( Y( :height ), X( :age ) );
);
fitYbyXvlb << Append( fitYbyX );
)
)
)
)
)
)
),
// Creates Tabed Windows for Test Data Information
// Temp Windows that get filled once the data is loaded
Tab Box(
"Example",
V List Box(
H List Box(
distrvlb = V List Box( distr = Graph Box() ),
plotvlb = V List Box( plot = Graph Box() ),
fitYbyXvlb = V List Box( fitYbyX = Graph Box() )
),
)
)
)
)
)
) << Maximize Window;