Skript neu kodierenIch versuche, Daten (0 in .) neu zu kodieren, nachdem ich sie mithilfe des Post-Query-Skripts von einem SQL-Server abgerufen habe. Ich erhalte am Ende meines Skripts eine Fehlermeldung. Ich kann das Skript in der Datentabelle selbst ausführen, möchte aber, dass dies automatisch geschieht, wenn ich die Daten eingebe.
Hier ist mein Drehbuch.
Eigenschaften zur Tabelle hinzufügen(
{Neues Skript(
„Neu kodieren“ ,
Aktuelle Datentabelle () << Beginnen Sie mit der Datenaktualisierung ;
Für jede Reihe ( :purity_2 = Übereinstimmen ( :purity_2, 0 , . , . , . , :purity_2 ) );
Für jede Reihe ( :purity_3 = Übereinstimmen ( :purity_3, 0 , . , . , . , :purity_3 ) );
Für jede Reihe ( :purity_4 = Übereinstimmen ( :purity_4, 0 , . , . , . , :purity_4 ) );
Für jede Reihe ( :plus50_2 = Übereinstimmen ( :plus50_2, 0 , . , . , . , :plus50_2 ) );
Für jede Reihe ( :plus100_2 = Übereinstimmen ( :plus100_2, 0 , . , . , . , :plus100_2 ) );
Für jede Reihe ( :plus140_2 = Übereinstimmen ( :plus140_2, 0 , . , . , . , :plus140_2 ) );
Aktuelle Datentabelle () << Datenaktualisierung beenden
}
Hier ist die Fehlermeldung:
Unerwartetes Ende der Eingabe. Möglicherweise fehlt ein „“,“ oder „)“.
Es wird versucht, Argumente der Funktion „Eigenschaften zur Tabelle hinzufügen“ zu analysieren.
Zeile 60 Spalte 45: Aktuelle Datentabelle() << Datenaktualisierung beenden;)}►
Danke,
Betreff: Skript neu kodierenBearbeiten: Ignorieren Sie das, es ist dasselbe wie Jims Beitrag oben.
Sie können die Nachricht „Neues Skript“ auch direkt an die Tabelle senden:
dt << New Script(
"Recode 2",
Current Data Table() << Begin Data Update;
For Each Row( :purity_2 = Match( :purity_2, 0, ., ., ., :purity_2 ) );
For Each Row( :purity_3 = Match( :purity_3, 0, ., ., ., :purity_3 ) );
For Each Row( :purity_4 = Match( :purity_4, 0, ., ., ., :purity_4 ) );
For Each Row( :plus50_2 = Match( :plus50_2, 0, ., ., ., :plus50_2 ) );
For Each Row( :plus100_2 = Match( :plus100_2, 0, ., ., ., :plus100_2 ) );
For Each Row( :plus140_2 = Match( :plus140_2, 0, ., ., ., :plus140_2 ) );
Current Data Table() << End Data Update;
);
Betreff: Skript neu kodierenSie müssen dies als Nachricht an Ihre Datentabelle senden.Hier ist eine Möglichkeit:
dt = current data table();
dt << Add Properties to Table(
{New Script(
"Recode",
Current Data Table() << Begin Data Update;
For Each Row( :purity_2 = Match( :purity_2, 0, ., ., ., :purity_2 ) );
For Each Row( :purity_3 = Match( :purity_3, 0, ., ., ., :purity_3 ) );
For Each Row( :purity_4 = Match( :purity_4, 0, ., ., ., :purity_4 ) );
For Each Row( :plus50_2 = Match( :plus50_2, 0, ., ., ., :plus50_2 ) );
For Each Row( :plus100_2 = Match( :plus100_2, 0, ., ., ., :plus100_2 ) );
For Each Row( :plus140_2 = Match( :plus140_2, 0, ., ., ., :plus140_2 ) );
Current Data Table() << End Data Update;
)});
Betreff: Skript neu kodierenIch habe nicht wirklich Erfahrung mit der Verwendung von „Eigenschaften zu Tabelle hinzufügen()“, aber beim Lesen der Definition im Skriptindex scheint es nicht so zu sein, dass das, was Sie versuchen, funktionieren wird.Die folgende Vereinfachung Ihres Skripts wird funktionieren
Names Default to Here( 1 );
Current Data Table() << New Script(
"Recode",
Current Data Table() << Begin Data Update;
For Each Row( :purity_2 = Match( :purity_2, 0, ., ., ., :purity_2 ) );
For Each Row( :purity_3 = Match( :purity_3, 0, ., ., ., :purity_3 ) );
For Each Row( :purity_4 = Match( :purity_4, 0, ., ., ., :purity_4 ) );
For Each Row( :plus50_2 = Match( :plus50_2, 0, ., ., ., :plus50_2 ) );
For Each Row( :plus100_2 = Match( :plus100_2, 0, ., ., ., :plus100_2 ) );
For Each Row( :plus140_2 = Match( :plus140_2, 0, ., ., ., :plus140_2 ) );
Current Data Table() << End Data Update;
);
Betreff: Skript neu kodierenDas hat nicht funktioniert, ich habe die folgende Meldung erhalten.
Eigenschaften zur Tabelle hinzufügen(
{Neues Skript(
„Neu kodieren“,
Aktuelle Datentabelle() << Datenaktualisierung beginnen;
Für jede Zeile( :purity_2 = Match( :purity_2, 0, ., ., ., :purity_2 ) );
Für jede Zeile( :purity_3 = Match( :purity_3, 0, ., ., ., :purity_3 ) );
Für jede Zeile( :purity_4 = Match( :purity_4, 0, ., ., ., :purity_4 ) );
Für jede Zeile( :plus50_2 = Match( :plus50_2, 0, ., ., ., :plus50_2 ) );
Für jede Zeile( :plus100_2 = Match( :plus100_2, 0, ., ., ., :plus100_2 ) );
Für jede Zeile( :plus140_2 = Match( :plus140_2, 0, ., ., ., :plus140_2 ) );
Aktuelle Datentabelle() << Datenaktualisierung beenden;
)}
) /*###*/;
Betreff: Skript neu kodierenAm Ende fehlt eine schließende Klammer.
Current Data Table() << End Data Update;)}<STRONG>);</STRONG>