Ri: domande sulla selezione dell'operazione logicaisMissing (x) restituisce 1 se manca x, 0 se non manca x. Puoi anche solo usare
isMissing (x) senza confrontarlo con 1 o 0; il valore restituito è lo stesso, ma potrebbe essere più facile da leggere:
If( :Height > "60" & isMissing( :Weight ) , ... )
or
If( :Height > "60" & ! isMissing( :Weight ) , ... )
notare il! che significa non .
Ri: domande sulla selezione dell'operazione logicagrazie funzionadomande sulla selezione dell'operazione logicaQuando uso lo script di seguito, la riga 4 non cambia in "sì", ma le altre righe cambiano. Aiuteresti a controllare di nuovo? Il mio scopo è capire che quando: Height> "60" & (and) isMissing (: Weight) == 0, entrambi si rendono conto, quindi il valore dell'altezza cambia in "Sì", altri valori non cambiano in altezza.
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// Set the value of JACLYN's weight to missing
// to allow for the test case, where the
// :Height is greater than 60, but the :Weight
// is missing
dt:Weight[4] = .;
// Since the column :height is numeric and a
// character value of "Yes" is to be placed in
// that column, the column needs to be changed
// to Data Type of Character
dt:Height << data type(character);
// Now a For Each Row() with a two level
// comparison can be used to change the
// described value
For Each Row(
If( :Height > "60" & isMissing( :Weight ) == 0,
:Height = "Yes"
)
);
