Hi,
I would like to choose two columns and do the formula. However, the variables in the formula have " " around the name and therefore is does not work. Aný suggestions?
dt = Current Data Table();
win = New Window( "Clean False Zeroes",
<<Modal,
Text Box( "Available Columns" ),
H List Box(
// list box to present cols
allcols = Col List Box( dt, all ), // or specify numeric instead of all
Lineup Box(
2,
bbx = Button Box( "X, Factor", xcols << append( allcols << get selected ) ),
// list box to receive cols
xcols = Col List Box( "Numeric", <<Modeling Type( {"Continuous"} ), min items( 1 ) ),
bby = Button Box( "Status, Response", ycols << append( allcols << get selected ) ),
// list box to receive cols
ycols = Col List Box( "Character", <<Modeling Type( {"Nominal"} ), min items( 1 ) )
),
V List Box(
bbOK = Button Box( "OK",
xvar = (xcols << Get Items);
yvar = (ycols << Get Items);
Show( xvar );
),
bbCancel = Button Box( "Cancel" )
)
)
);
// stop the script if user chooses Cancel
If( win["Button"] == -1,
Throw( "User Cancelled" )
);
FalseZeroes = Expr(
dt << New Column( "Temp", Numeric, "Continuous", Format( "Best", 12 ), formula( If( Is Missing( :Expr( yvar ) ), ., :Expr( xvar ) ) ) )
);
Eval( Eval Expr( FalseZeroes ) );