So weisen Sie JMP an, das Skript weiter auszuführen, wenn eine Spalte fehltHallo, kann jemand beim Erstellen einer Übersichtstabelle unten wissen, wie man in JSL codiert, damit das Skript weiter ausgeführt werden kann, wenn eine der folgenden Spalten nicht vorhanden ist?
dt3 << Zusammenfassung(Summe( :Fehler, :Nicht bewertet, :Schwach));
Vielen Dank!
DatentabelleSkriptingBetreff: Wie man JMP anweist, das Skript weiter auszuführen, wenn eine Spalte fehltSie müssen in der Liste der zusammenzufassenden Spalten ein wenig Code-Safing durchführen.
Hier ist mein Beispiel:
dt3 = Current Data Table();
columns to summarize = {"fail", "not assessed", "weak"}; //columns you're interestd in, may or may not exist within table
column names = dt3 << Get Column Names( "String" ); //we need to grab the table columns to utilize only available columns
columns as names = {}; //we need to wrap both column names and our columns of interest in
For( i = 1, i <= N Items( column names ), i++, // 'As Name( ... )' to avoid issues with capitalization and such
columns as names[i] = As Name( column names[i] ) // loop here
);
columns to summarize within table = {};
For( i = 1, i <= N Items( columns to summarize ), i++,
If( Contains( columns as names, As Name( columns to summarize[i] ) ), // check to see that name exists as column header
Insert Into( columns to summarize within table, columns to summarize[i] )
)
);
Eval( Eval Expr(
dt3 << Summary( Expr( Substitute( columns to summarize within table, {}, Expr( Sum ) ) ) ) //fancy substitution for the summary table
) )