Qual è il modo migliore per aggiornare il valore della nuova variabile di tabella all'interno di una funzione.In questo momento, lo sto facendo come di seguito. Tuttavia, ho scoperto che questa variabile Giorni non verrà aggiornata e creerà una nuova variabile chiamata Days 2.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << New Table Variable( "Days", 42 ); // In original data table, Days set to default which is 42
// assume below is a new function, and I'm passing dt as input and I want to update the Days variable
myFunction = Function ({dt},
// I want this Days variable get updated with new value below, 100
dt << New Table Variable ( "Days", 100);
dt << Select Where( :Name( "sex" ) == "F" );
dt << Subset( Copy formula( 1 ), Suppress formula evaluation( 0 ), Selected Rows( 1 ), Selected columns only( 0 ) );
dt = Data Table (Current Data Table() << Get Name());
);
myFunction(dt)