Hello,
I have been trying to write a script to create a subset of a larger data table. The new subset should contain a subject ID number, D.O.B, and a Range of Selected Dates. I wrote a script that asks for the ID#, start date, and end date in three different text boxes. (Included below, and it's far from perfect). However, I would like some drop down menus in the pop-up window as to show what ID#s are available for the current data table, and the accompanying dates for that subject. Following the example from here, http://www.jmp.com/support/notes/54/614.html, I have tried working with Combo Boxes, but can't seem to get it right.
Where the problem comes down to is making the second/third drop down menu react accordingly to the ID# selection. Things I have noticed: Summarize and Associative Array help reduce duplicate dates and white spaces, and dates are not in the prefered "m/d/y".
Any Help Appreciated!
dt = Current Data Table();
Column(dt, "Coll Date") << Data Type("Numeric", Informat("m/d/y"), Format("m/d/y") );
Column(dt, "Coll Date") << Modeling Type("Continuous");
Column(dt, "Coll Date") << Order(Ascending);
nw = New Window( "Subject ID by Date Range.",
<<Modal,
V List Box( Text Box( "Select an ID# and Date Range. " ), Spacer Box( Size( 25, 25 ) ) ),
V List Box(
Lineup Box(
3,
Text Box( "Subject ID: " ),
sub = Number Edit Box( . ),
Text Box( "Start Date: " ),
start = Text Edit Box( . ),
Text Box( "End Date: " ),
end = Text Edit Box( . )
),
Spacer Box( Size( 25, 25 ) ),
H List Box(
Button Box( "Click to Update First",
subid = sub << Get;
startDate = start << Get Text;
endDate = end << Get Text;
)
)
)
);
For Each Row(
Selected( Row State() ) = :Patient ID1 == subid & Format( :Coll Date, "m/d/y" )
>= Char( startDate ) & Format( :Coll Date, "m/d/y" ) <= Char( endDate )
);
subdt = dt << Subset(
Columns( :Patient ID1, :DOB, :Coll Date ),
Output Table Name( "subset" ),
);
subdt<< sort(by(:Coll Date), Replace Table);
A