cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-46546%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EScriptable%5B%5D%20oder%20%E2%80%9ESenden%20erwartet%20skriptf%C3%A4higes%20Objekt%E2%80%9C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-46546%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EHallo%2C%3C%2FP%3E%0A%3CP%3EIch%20habe%20viele%20Methoden%20ausprobiert%2C%20um%20bestimmte%20Zeilen%20mit%20PM%23%3D2%20und%20Logistic%23%3D1%20in%20meiner%20vorgefilterten%20Tabelle%20auszuw%C3%A4hlen%2C%20aber%20ich%20erhalte%20entweder%20die%20Meldung%20%E2%80%9ESende%20erwartet%20skriptf%C3%A4higes%20Objekt%E2%80%9C%20oder%20%E2%80%9ESkriptf%C3%A4hig%5B%5D%E2%80%9C%20und%20dann%20Skriptbeendigung%20oder%20eine%20Endlosschleife.Kann%20mir%20bitte%20jemand%20helfen%2C%20was%20an%20der%20Syntax%20unpassend%20ist%2C%20dass%20ich%20die%20Zeilenauswahl%20nicht%20programmieren%20kann%3FDanke!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Elamstationfile%3DPick%20File(%22choose%20file%22%2C%22%24Documents%22%20)%3B%0Adt%3DOpen(lamstationfile%2C%0AImport%20Settings(End%20Of%20Field(%20Tab%20)%2CScan%20Whole%20File(%201%20)%2C%20Column%20Names%20Start(7%20)%2CData%20Starts(%208)%2C))%3B%0Adt%20%3D%20Current%20Data%20Table()%3B%0A%0A%2F%2Ffind%20data%20rows%0Aw%3DNRow(dt)%3B%0Adt%26lt%3B%3CSELECT%20where%3D%22%22%3E(d-1))%3B%0Adt2%3Ddt%26lt%3B%3CSUBSET%3E(d-1))%26lt%3B%3CDELETE%20rows%3D%22%22%3E%3C%2FDELETE%3E%3C%2FSUBSET%3E%3C%2FSELECT%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-46639%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Scriptable%5B%5D%20oder%20%E2%80%9ESenden%20erwartet%20skriptf%C3%A4higes%20Objekt%E2%80%9C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-46639%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBei%20den%20von%20Ihnen%20angeh%C3%A4ngten%20Daten%20handelt%20es%20sich%20um%20eine%20Datei%2C%20die%20ich%20nicht%20%C3%B6ffnen%20kann.%3CBR%20%2F%3E%20K%C3%B6nnen%20Sie%20nur%20eine%20kleine%20Teilmenge%20der%20Tabelle%20bereitstellen%2C%20mit%20der%20Sie%20arbeiten%20m%C3%B6chten%3F%3CBR%20%2F%3E%20Ich%20kann%20mir%20einen%20Grund%20vorstellen%2C%20warum%20Ihre%20Zeilenauswahl%20nicht%20funktioniert.%3CBR%20%2F%3E%3CBR%20%2F%3E%20K%C3%B6nnen%20Sie%20neben%20der%20Bereitstellung%20eines%20Beispieldatensatzes%20auch%20Folgendes%20ausprobieren%3F%3CBR%20%2F%3E%20dt%20%3D%20Aktuelle%20Datentabelle()%3B%3CBR%20%2F%3E%20F%C3%BChren%20Sie%20dann%20Ihre%20Auswahl%20aus%2C%20wobei%20dt%20die%20Datentabelle%20ist%2C%20mit%20der%20Sie%20arbeiten.%3CBR%20%2F%3E%20Wenn%20JMP%20die%20Referenz%20der%20Datentabelle%20nicht%20erkennt%20oder%20verloren%20hat%2C%20funktioniert%20der%20Zeilenauswahlvorgang%20unabh%C3%A4ngig%20von%20Ihrem%20Ansatz%20nicht.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-46637%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Scriptable%5B%5D%20oder%20%E2%80%9ESenden%20erwartet%20skriptf%C3%A4higes%20Objekt%E2%80%9C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-46637%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EDanke%20f%C3%BCr%20Ihre%20Antwort.%20Ich%20glaube%2C%20dieser%20Tippfehler%20ist%20nur%20passiert%2C%20als%20ich%20den%20Code%20in%20die%20Online-Diskussion%20%C3%BCbertragen%20habe.%20Es%20gab%20keinen%20Tippfehler%20auf%20meinem%20Computer%2C%20sonst%20h%C3%A4tte%20ich%20einen%20anderen%20Fehler%20erhalten.%20Au%C3%9Ferdem%20haben%20Methode%20Nr.%201%2C%20Nr.%203%20und%20Nr.%204%20bei%20mir%20ebenfalls%20nicht%20funktioniert.%20Nicht%20sicher%20warum.%3CBLOCKQUOTE%3E%3CHR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F6696%22%20target%3D%22_blank%22%3E%40uday_guntupalli%3C%2FA%3E%20schrieb%3A%3CBR%20%2F%3E%20dt3%20%26lt%3B%3CSELECT%20where%3D%22%22%3E%3C%2FSELECT%3E%3C%2FBLOCKQUOTE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-46610%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Scriptable%5B%5D%20oder%20%E2%80%9ESenden%20erwartet%20skriptf%C3%A4higes%20Objekt%E2%80%9C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-46610%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EIch%20dachte%2C%20dass%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F6696%22%20target%3D%22_blank%22%3E%20%40uday_guntupalli%3C%2FA%3E%20Der%20Code%20sollte%20funktionieren%2C%20in%2013.2.1%20jedoch%20nicht%20(seltsam).Durch%20die%20Verwendung%20von%20As%20Column()%20anstelle%20von%20Column()%20konnte%20Ihr%20spezifischer%20Code%20jedoch%20funktionieren%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0Adt3%20%3D%20Open(%20%22%24SAMPLE_DATA%2FBig%20Class.jmp%22%20)%3B%0Alogis%20%3D%20%2255%22%3B%0Aclos%20%3D%20%22Height%22%3B%0Adt3%20%26lt%3B%26lt%3B%20Select%20Where(%20As%20Column(%20dt3%2C%20clos%20)%20%3D%3D%20Num(%20logis%20)%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-46609%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Scriptable%5B%5D%20oder%20%E2%80%9ESenden%20erwartet%20skriptf%C3%A4higes%20Objekt%E2%80%9C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-46609%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3Edt3%20%26lt%3B%3CSELECT%20where%3D%22%22%3E%3CLINGO-SUB%20id%3D%22lingo-sub-46608%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Scriptable%5B%5D%20oder%20%E2%80%9ESenden%20erwartet%20skriptf%C3%A4higes%20Objekt%E2%80%9C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-46608%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EEntschuldigung%2C%20ich%20h%C3%A4tte%20klarer%20sein%20sollen.Das%20Problem%2C%20das%20ich%20habe%2C%20ist%20das%20Ende%20meines%20Codes%2C%20nachdem%20ich%20eine%20dritte%20Datentabelle%20dt3%20erstellt%20habe.%20Alles%20vor%20der%20letzten%20aktiven%20Codezeile%20funktioniert%20einwandfrei%20%5BZeilen%20und%20Spalten%20in%20der%20ersten%20Datentabelle%20dt%20abrufen%2C%20die%20Eingaben%20PM%23%3D2%20und%20Logistic%23%3D1%20setzen%20sind%20in%20Ordnung%5D.Ich%20kann%20einfach%20nicht%20mehrere%20Zeilen%20in%20dt3%20ausw%C3%A4hlen%2C%20in%20denen%20Logistic%23%20%3D1%20ist.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIch%20habe%20mehrere%20verschiedene%20Methoden%20ausprobiert%2C%20wie%20im%20folgenden%20Codeauszug%20beschrieben%2C%20aber%20entweder%20wird%20der%20Code%20mit%20dem%20Hinweis%20%E2%80%9EScriptable%5B%5D%E2%80%9C%20oder%20dem%20Fehler%20%E2%80%9ESenden%20erwartet%20skriptf%C3%A4higes%20Objekt%E2%80%9C%20beendet.Ich%20bin%20mir%20nicht%20sicher%2C%20wo%20im%20folgenden%20Code%20die%20ordnungsgem%C3%A4%C3%9Fe%20Ausf%C3%BChrung%20verhindert%20wird.%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22%20language-jsl%22%3E%3CCODE%20class%3D%22%20%20language-jsl%22%3E%3CSPAN%20class%3D%22token%20comment%22%3E%2F%2Fdt3%26lt%3B%3CGET%20rows%3D%22%22%20where%3D%22%22%3E%0A%20%0Adt3%3CSPAN%20class%3D%22token%20operator%22%3E%26lt%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22token%20operator%22%3E%26lt%3B%3C%2FSPAN%3ESelet%20Where%3CSPAN%20class%3D%22token%20punctuation%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22token%20punctuation%22%3E%3A%3C%2FSPAN%3E%3CSPAN%20class%3D%22token%20function%22%3EColumn%3C%2FSPAN%3E%3CSPAN%20class%3D%22token%20punctuation%22%3E(%3C%2FSPAN%3E%20dt3%3CSPAN%20class%3D%22token%20punctuation%22%3E%2C%3C%2FSPAN%3E%20clos%20%3CSPAN%20class%3D%22token%20punctuation%22%3E)%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22token%20operator%22%3E%3D%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22token%20function%22%3ENum%3C%2FSPAN%3E%3CSPAN%20class%3D%22token%20punctuation%22%3E(%3C%2FSPAN%3E%20logis%20%3CSPAN%20class%3D%22token%20punctuation%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22token%20punctuation%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22token%20punctuation%22%3E%3B%3C%2FSPAN%3E%20%20%20%3CSPAN%20class%3D%22token%20comment%22%3E%2F%2FMethod%232%3C%2FSPAN%3E%0A%20%0A%3CSPAN%20class%3D%22token%20comment%22%3E%2F%2FFor(i%3D1%2C%20i%3DNRows(dt3)%2C%20i%2B%2B%2C%20%20%20%20%2F%2FMethod%233%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22token%20comment%22%3E%2F%2FIf(%20Column(%20dt3%2C%20clos%20)%5Bi%5D%20%3D%3D%20Num(%20logis%20)%2C%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22token%20comment%22%3E%2F%2F%20Column(%20dt3%2C%20clos%20)%5Bi%5D%20%26lt%3B%26lt%3B%20Set%20Selected(%201%20))%3B%20%20)%3B%3C%2FSPAN%3E%0A%20%0A%20%0A%3CSPAN%20class%3D%22token%20comment%22%3E%2F%2FFor%20Each%20Row(If(%20%3AColumn(%20dt3%2C%20clos%20)%20%3D%3D%20Num(%20logis%20)%2C%20%3AColumn(%20dt3%2C%20clos%20)%20%26lt%3B%26lt%3B%20Set%20%2F%2FSelected(1))%3B%20%20%2F%2FMethod%234%3C%2FSPAN%3E%3C%2FGET%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-46558%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Scriptable%5B%5D%20oder%20%E2%80%9ESenden%20erwartet%20skriptf%C3%A4higes%20Objekt%E2%80%9C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-46558%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EHier%20ist%20ein%20Skript%2C%20das%20das%20erste%20Problem%20in%20Ihrer%20Datentabelle%20abdeckt%20und%20eine%20Zeile%20ausw%C3%A4hlt%2C%20nachdem%20%E2%80%9ENUM_DATA_ROWS%E2%80%9C%20gefunden%20wurde%3A%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Elamstationfile%20%3D%20Pick%20File(%20%22choose%20file%22%2C%20%22%24Documents%22%20)%3B%0Adt%20%3D%20Open(%20lamstationfile%2C%20Import%20Settings(%20End%20Of%20Field(%20Tab%20)%2C%20%0AScan%20Whole%20File(%201%20)%2C%20Column%20Names%20Start(%207%20)%2C%20Data%20Starts(%208%20)%2C%20)%20)%3B%0Adt%20%3D%20Current%20Data%20Table()%3B%0A%0A%2F%2Ffind%20data%20rows%0Aw%20%3D%20N%20Row(%20dt%20)%3B%0Adt%20%26lt%3B%26lt%3B%20Select%20Where(%20%3ATime%20%3D%3D%20%22NUM_DATA_ROWS%22%20)%20%26lt%3B%26lt%3B%20Label(%201%20)%3B%0Ad%20%3D%20dt%20%26lt%3B%26lt%3B%20Get%20Selected%20Rows%3B%0AShow(%20d%20)%3B%0A%2F%2F%20A%20matrix%20is%20returned%20from%20%26lt%3B%26lt%3B%20Get%20Selected%20Rows%2C%20so%20you%20need%20to%20reference%20d%5B1%5D%0Adt%20%26lt%3B%26lt%3B%20Select%20Where(%20Row()%20%26gt%3B%20(d%5B1%5D%20-%201)%20)%3B%0Adt2%20%3D%20dt%20%26lt%3B%26lt%3B%20Subset(%20Selected%20Rows(%201%20)%2C%20Selected%20columns%20only(%200%20)%20)%3B%0Adt%20%2F*%26lt%3B%26lt%3B%20Select%20Where(%20Row()%20%26gt%3B%20(d%20-%201)%20)*%2F%20%26lt%3B%26lt%3B%20Delete%20Rows%3B%0A%2F%2F%20Change%20first%20two%20columns%20to%20numeric%20data%0AColumn(%20dt%2C%201%20)%20%26lt%3B%26lt%3B%20Data%20Type(%20Numeric%20)%3B%0AColumn(%20dt%2C%201%20)%20%26lt%3B%26lt%3B%20Modeling%20Type(%20%22Continuous%22%20)%3B%0AColumn(%20dt%2C%201%20)%20%26lt%3B%26lt%3B%20format(%22hr%3Am%3As%22)%3B%0AColumn(%20dt%2C%202%20)%20%26lt%3B%26lt%3B%20Data%20Type(%20Numeric%20)%3B%0AColumn(%20dt%2C%202%20)%20%26lt%3B%26lt%3B%20Modeling%20Type(%20%22Continuous%22%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EWas%20die%20Auswahl%20der%20Spalten%20und%20die%20anschlie%C3%9Fende%20Unterteilung%20betrifft%2C%20w%C3%BCrde%20ich%20vorschlagen%2C%20dass%20Sie%20das%20integrierte%20Spaltenauswahltool%20%E2%80%9EColumns%20Viewer%E2%80%9C%20verwenden%2C%20anstatt%20Ihr%20eigenes%20Auswahltool%20zu%20erstellen.%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edt%20%26lt%3B%26lt%3B%20Columns%20Viewer%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-46552%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Scriptable%5B%5D%20oder%20%E2%80%9ESenden%20erwartet%20skriptf%C3%A4higes%20Objekt%E2%80%9C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-46552%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EEntschuldigung.Die%20Daten%20sind%20nun%20entsprechend%20angeh%C3%A4ngt.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-46547%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Scriptable%5B%5D%20oder%20%E2%80%9ESenden%20erwartet%20skriptf%C3%A4higes%20Objekt%E2%80%9C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-46547%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F10002%22%20target%3D%22_blank%22%3E%40asdf%3C%2FA%3E%20%3A%3CBR%20%2F%3E%20Die%20Anhangdatei%20(.zip)%20ist%20leer.%20Ihre%20Daten%20wurden%20also%20nicht%20zum%20Testen%20Ihres%20Codes%20und%20zur%20Fehlersuche%20bereitgestellt.%3CBR%20%2F%3EDa%20die%20tats%C3%A4chlichen%20Daten%2C%20mit%20denen%20Sie%20arbeiten%2C%20fehlen%2C%20sehen%20wir%20uns%20hier%20dieses%20Beispiel%20an.%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edt%20%3D%20Open(%20%22%24SAMPLE_DATA%2FAir%20Traffic.jmp%22%20)%3B%0A%0Adt%20%26lt%3B%26lt%3B%20Select%20Where(%3AAirline%20%3D%3D%20%22Delta%22%20%26amp%3B%20%3AEvent%20%3D%3D%20%22Arrive%22)%3B%20%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EWie%20Sie%20sehen%2C%20k%C3%B6nnen%20Sie%20Zeilen%20ausw%C3%A4hlen%2C%20in%20denen%20zwei%20unterschiedliche%20Bedingungen%20in%20zwei%20verschiedenen%20Spalten%20erf%C3%BCllt%20sind.%3CBR%20%2F%3E%3CBR%20%2F%3EIn%20Ihrem%20Fall%20-%20wenn%20die%3CSPAN%3E%20PM%23%3D2%20und%20Logistic%23%3D1%20beziehen%20sich%20auf%20zwei%20verschiedene%20Tabellen%20%E2%80%93%20dann%20m%C3%BCssen%20Sie%20die%20Tabellen%20basierend%20auf%20gemeinsamen%20Spalten%20f%C3%BCr%20das%2C%20was%20Sie%20suchen%2C%20zusammenf%C3%BChren.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EWenn%20dies%20auch%20nicht%20der%20Fall%20ist%2C%20stellen%20Sie%20bitte%20tats%C3%A4chliche%20Beispieldaten%20bereit.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3C%2FSELECT%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
asdf
Level I

Scriptable[] or 'send expects scriptable object'

Hi,

I've tried many methods of trying to select specific rows with PM#=2 and  Logistic#=1 in my pre-filtered table, but I either get a 'Send expects scriptable object' message, a 'Scriptable[]' and then script termination, or an endless loop.  Can someone please help with what is inappropriate with the syntax that I cannot program the row selection?  Thanks!

 

 

lamstationfile=Pick File("choose file","$Documents" );
dt=Open(lamstationfile,
Import Settings(End Of Field( Tab ),Scan Whole File( 1 ), Column Names Start(7 ),Data Starts( 8),));
dt = Current Data Table();

//find data rows
w=NRow(dt);
dt<<Select Where(:Time=="NUM_DATA_ROWS")<<Label(1);
d=dt<<Get Selected Rows;
Show(d);
dt<<Select Where(Row()>(d-1));
dt2=dt<<Subset( Selected Rows(1), Selected columns only(0));
dt<<Select Where(Row()>(d-1))<<Delete Rows;
// Change first two columns to numeric data
Column(dt,1)<< Data Type (Numeric); Column(dt,1)<<Modeling Type("Continuous");
Column(dt,2)<< Data Type (Numeric); Column(dt,2)<<Modeling Type("Continuous");
 

nw= New Window( "What PM?",<<Modal,<<Bring Window To Front,
V List Box( Text Box( "PM#"), pm_in = Text Edit Box("PM#", <<Justify Text (Center)), Spacer Box(Size(25,25))),
H List Box( Button Box("OK", pm= pm_in << Get Text();), Button Box("Cancel", nw<<Close Window)));
nw= New Window( "What Logistic?",<<Modal,<<Bring Window To Front,
V List Box( Text Box( "Logistic#"), wafer_in =Text Edit Box("Logistic#"), Spacer Box(Size(25,25))),
H List Box( Button Box("OK", logis= wafer_in << Get Text();), Button Box("Cancel", nw<<Close Window)));
//take out uneccessary PM data
Show("PM"|| pm);
ColNames = dt << Get Column Names();
colstrings = char(colnames);
match = regex(colstrings, "PM"|| pm);
//Show(colstrings);
found_list={};
close(dt2,no save);
//how can I have it with 2 dt open?
for (i = 1, i <= nitems(ColNames), i++,
if (contains(ColNames[i], match),
ColNames[i]<<Set Selected(1)
//insertinto(found_list, ColNames[i]);
);
);
Column(dt,1)<<Set Selected(1);
//For found_list<<Set Selected(1);
//Show(found_list);
dt3=dt<<Subset( Selected Rows(0), Selected columns only(1));

Num(logis);
Show(logis);
//Logistics column is the last in the table
clos=NCol(dt3);
Show(clos);
Show( Column( dt3, clos )[2] );
 
//dt3<<Get Rows Where(:Column(clos)==logis);  //Method #1
 
dt3<<Selet Where(:Column( dt3, clos ) == Num( logis ));   //Method#2
 
//For(i=1, i=NRows(dt3), i++,    //Method#3
//If( Column( dt3, clos )[i] == Num( logis ),
// Column( dt3, clos )[i] << Set Selected( 1 ));  );
 
 
//For Each Row(If( :Column( dt3, clos ) == Num( logis ), :Column( dt3, clos ) << Set //Selected(1));  //Method#4

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Scriptable[] or 'send expects scriptable object'

I thought that @uday_guntupalli code should work, however in 13.2.1 it would not(strange).  However, using As Column() instead of Column() allowed your specific code to work

Names Default To Here( 1 );
dt3 = Open( "$SAMPLE_DATA/Big Class.jmp" );
logis = "55";
clos = "Height";
dt3 << Select Where( As Column( dt3, clos ) == Num( logis ) );
Jim

View solution in original post

8 REPLIES 8
uday_guntupalli
Level VIII

Re: Scriptable[] or 'send expects scriptable object'

@asdf : 
    Attachment (.zip) file is empty - so your data was not provided to test your code and see you error to troubleshoot . 
   In the absence of the actual data you are working with - here lets look at this example . 

dt = Open( "$SAMPLE_DATA/Air Traffic.jmp" );

dt << Select Where(:Airline == "Delta" & :Event == "Arrive"); 

  As you can see - you can select rows where two different conditions on two different columns are being met. 

  In your case - if the PM#=2 and  Logistic#=1 refer to 2 different tables - then you need to join the tables based on common columns for what you are after. 

  If its not either - please provide actual sample data .

Best
Uday
asdf
Level I

Re: Scriptable[] or 'send expects scriptable object'

Sorry.  The data is now appropriately attached.

txnelson
Super User

Re: Scriptable[] or 'send expects scriptable object'

Here is a script that covers the first issue in your data table, selecting row after finding "NUM_DATA_ROWS:

lamstationfile = Pick File( "choose file", "$Documents" );
dt = Open( lamstationfile, Import Settings( End Of Field( Tab ), 
Scan Whole File( 1 ), Column Names Start( 7 ), Data Starts( 8 ), ) );
dt = Current Data Table();

//find data rows
w = N Row( dt );
dt << Select Where( :Time == "NUM_DATA_ROWS" ) << Label( 1 );
d = dt << Get Selected Rows;
Show( d );
// A matrix is returned from << Get Selected Rows, so you need to reference d[1]
dt << Select Where( Row() > (d[1] - 1) );
dt2 = dt << Subset( Selected Rows( 1 ), Selected columns only( 0 ) );
dt /*<< Select Where( Row() > (d - 1) )*/ << Delete Rows;
// Change first two columns to numeric data
Column( dt, 1 ) << Data Type( Numeric );
Column( dt, 1 ) << Modeling Type( "Continuous" );
Column( dt, 1 ) << format("hr:m:s");
Column( dt, 2 ) << Data Type( Numeric );
Column( dt, 2 ) << Modeling Type( "Continuous" );

Concerning your selection of columns and then subsetting, I would suggest that you use the builtin column selection tool, "Columns Viewer" rather than building your own selection tool.

dt << Columns Viewer;
Jim
asdf
Level I

Re: Scriptable[] or 'send expects scriptable object'

Sorry, I should have been more clear.  The problem I am having is with the end of my code after I've created a third data table dt3.  Everything before the last active line of code works fine [getting rows and columns in first data table dt, setting the inputs PM#=2 and Logistic#=1 are fine ].  I just cannot select several rows in dt3 where Logistic# =1 . 

 

I've tried several different methods as noted in the code excerpt below, but I either get code terminated with 'Scriptable[]' note or 'Send expects scriptable object' error.  I'm not sure where in the below code is preventing it from running appropriately.

  

 

 

//dt3<<Get Rows Where(:Column(clos)==logis);  //Method #1
 
dt3<<Selet Where(:Column( dt3, clos ) == Num( logis ));   //Method#2
 
//For(i=1, i=NRows(dt3), i++,    //Method#3
//If( Column( dt3, clos )[i] == Num( logis ),
// Column( dt3, clos )[i] << Set Selected( 1 ));  );
 
 
//For Each Row(If( :Column( dt3, clos ) == Num( logis ), :Column( dt3, clos ) << Set //Selected(1));  //Method#4

 

uday_guntupalli
Level VIII

Re: Scriptable[] or 'send expects scriptable object'

dt3 <<Select Where(:Column( dt3, clos ) == Num( logis )); // There is a typo to start with
Best
Uday
txnelson
Super User

Re: Scriptable[] or 'send expects scriptable object'

I thought that @uday_guntupalli code should work, however in 13.2.1 it would not(strange).  However, using As Column() instead of Column() allowed your specific code to work

Names Default To Here( 1 );
dt3 = Open( "$SAMPLE_DATA/Big Class.jmp" );
logis = "55";
clos = "Height";
dt3 << Select Where( As Column( dt3, clos ) == Num( logis ) );
Jim
asdf
Level I

Re: Scriptable[] or 'send expects scriptable object'

Thank you for your response. I think that typo only happened when I was transferring the code to the Online Discussion. There wasn't a typo on my computer, otherwise I would have gotten a different error. Also, Method#1, #3, and #4 didn't work for me either. Not sure why.

@uday_guntupalli wrote:
dt3 <<Select Where(:Column( dt3, clos ) == Num( logis ));
uday_guntupalli
Level VIII

Re: Scriptable[] or 'send expects scriptable object'

The data that you attached is a file , I am unable to open .
Can you just provide a small subset of the table you are trying to work with ?
One reason I can think of as to why your row selection doesn't work .

Besides providing sample data set , can you try this ?
dt = Current Data Table();
And then run your selection where dt is the data table you are working with .
If JMP doesn't recognize or has lost the reference of the data table , then irrespective of your approach - the row selection operation will not work .
Best
Uday

Recommended Articles