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-48867%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EFrage%20zur%20Funktion%20%E2%80%9EZeilen%20hinzuf%C3%BCgen%E2%80%9C.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-48867%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EAlle%2C%3C%2FP%3E%3CP%3EIch%20verwende%20JMP%2013.1.0%20auf%20einem%20Windows%207-Computer.%3C%2FP%3E%3CP%3EIch%20versuche%2C%20nach%20einer%20bestimmten%20Zeile%20Zeilen%20zu%20einer%20Datentabelle%20hinzuzuf%C3%BCgen.%3C%2FP%3E%3CP%3ELaut%20der%20Dokumentation%20(%20%3CA%20href%3D%22http%3A%2F%2Fwww.jmp.com%2Fsupport%2Fhelp%2F13-2%2FAdd_Rows_2.shtml)%20%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttp%3A%2F%2Fwww.jmp.com%2Fsupport%2Fhelp%2F13-2%2FAdd_Rows_2.shtml)%3C%2FA%3E%20%2C%20auf%20die%20ich%20verweise%2C%20ist%20die%20richtige%20Vorgehensweise%3A%3C%2FP%3E%3CP%3E%20%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edt%20%26lt%3B%26lt%3B%20Add%20Rows(%203%2C%2010%20)%3B%20%2F*%20add%203%20rows%20after%20the%2010th%20row%2C%20moving%20the%2011th%20and%20lower%20rows%20farther%20down%20*%2F%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EJetzt%20erweitere%20ich%20das%2C%20um%20Folgendes%20zu%20tun%3A%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edt1%20%3D%20Open(%20%22%24SAMPLE_DATA%2FBig%20Class.jmp%22%20)%3B%20%2F%2F%20Open%20Sample%20Data%20%0A%0ARowStyle1%20%3D%20%7B%3Aname%20%3D%20%22Mark%22%2C%3Aage%20%3D%2012%2C%3Asex%20%3D%20%22M%22%2C%3Aheight%20%3D%2080%2C%3Aweight%20%3D%20102%7D%3B%20%2F%2F%20Define%20Row%20To%20Add%20%0A%0ARowIndex%20%3D%201%20%3B%20%2F%2F%20Define%20position%20to%20add%20desired%20row%20%0A%0Adt1%20%26lt%3B%26lt%3B%20Add%20Rows(RowStyle1%2CRowIndex)%3B%20%2F%2F%20Add%20Rows%20.%20%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EDas%20Ergebnis%20dieses%20Codest%C3%BCcks%20ist%20im%20Screenshot%20unten%20dargestellt%3A%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20397px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20397px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F8758i07EEA692FAC806C4%2Fimage-dimensions%2F397x167%3Fv%3Dv2%22%20width%3D%22397%22%20height%3D%22167%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%20Sollte%20die%20Zeile%20nicht%20nach%20Zeile%201%20hinzugef%C3%BCgt%20werden%2C%20wodurch%20im%20Wesentlichen%20die%20Zeilen%202%20bis%2040%20nach%20unten%20verschoben%20werden%3F%3CBR%20%2F%3E%20Kann%20jemand%20darauf%20hinweisen%2C%20was%20ich%20hier%20falsch%20mache%3F%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EAu%C3%9Ferdem%20m%C3%B6chte%20ich%20noch%20eine%20Frage%20zu%20Add%20Rows()%20hinzuf%C3%BCgen%3A%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ERowStyle2%20%3D%20%7B%3Aname%20%3D%20%22Mark%22%2C%3Aage%20%3D%2012%2C%3Asex%20%3D%20%22M%22%2C%3Aheight%20%3D%2080%2C%3Aweight%20%3D%20%3Aweight%5B1%5D%2F2%7D%3B%20%2F%2F%20Define%20Row%20To%20Add%20%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EWenn%20ich%20anstelle%20eines%20vordefinierten%20Werts%20einen%20dynamischen%20Wert%20wie%20oben%20gezeigt%20verwenden%20m%C3%B6chte%3A%20RowStyle2%20vs.%20RowStyle1%20%E2%80%93%20sollte%20ich%20Ausdr%C3%BCcke%20verwenden%3F%20Wenn%20ja%2C%20geben%20Sie%20bitte%20ein%20Beispiel%20an.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-49470%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EBetreff%3A%20Frage%20zur%20Funktion%20%E2%80%9EZeilen%20hinzuf%C3%BCgen%E2%80%9C.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-49470%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EErstellen%20Sie%20eine%20neue%20Spalte%20und%20geben%20Sie%20ihr%20die%20Formel%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Ecol%20cumulative%20sum(%20%3ACost%20)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-49465%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EBetreff%3A%20Frage%20zur%20Funktion%20%E2%80%9EZeilen%20hinzuf%C3%BCgen%E2%80%9C.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-49465%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHallo%20zusammen.%3C%2FP%3E%3CP%3EIch%20habe%20eine%20Tabelle%20wie%20diese%3A%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EModul%20MONATSKOSTEN%3C%2FP%3E%3CP%3ESTHI%201%2015%3C%2FP%3E%3CP%3E%3CSPAN%3ESTHI%202%2020%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ESTHI%203%2025%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ESTHI%205%2030%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EOLB%201%2044%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EOLB%202%2054%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EOLB%204%2033%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EOLB%205%2022%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CSPAN%3EWie%20Sie%20sehen%20k%C3%B6nnen%2C%20fehlen%20im%20Monatskolluum%20einige%20Monate%20hintereinander.%20und%20ich%20m%C3%B6chte%20auch%20die%20Kostenspalte%20basierend%20auf%20dem%20Modul%20in%20einer%20neuen%20Spalte%20summieren.%20Die%20neue%20Tabelle%20sieht%20folgenderma%C3%9Fen%20aus%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CSPAN%3EGesamtkosten%20der%20Modulmonatskosten%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ESTHI%201%2015%2015%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ESTHI%202%2020%2035%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ESTHI%203%2025%2060%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ESTHI%204%200%2060%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ESTHI%205%2030%2090%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EOLB%201%2044%2044%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EOLB%202%2054%2098%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EOLB%203%200%2098%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EOLB%204%2033%20131%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EOLB%205%2022%20153%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CSPAN%3EGibt%20es%20eine%20M%C3%B6glichkeit%2C%20so%20auf%20den%20Tisch%20zu%20%C3%BCbertragen%3F%20K%C3%B6nnten%20Sie%20mir%20bitte%20helfen%3F%20Vielen%20Dank%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-48876%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EBetreff%3A%20Frage%20zur%20Funktion%20%E2%80%9EZeilen%20hinzuf%C3%BCgen%E2%80%9C.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-48876%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F4386%22%20target%3D%22_blank%22%3E%40Byron_JMP%3C%2FA%3E%20%2C%20vielleicht%20m%C3%B6chten%20Sie%20sich%20den%20Blog%20von%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F982%22%20target%3D%22_blank%22%3E%40Craige_Hales%3C%2FA%3E%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FUncharted%2FData-table-subscripting%2Fba-p%2F21013%22%20target%3D%22_self%22%3Ezum%20Abonnieren%20von%20Datentabellen%3C%2FA%3E%20ansehen%2C%20um%20weitere%20coole%20Beispiele%20wie%20dieses%20zu%20finden.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-48875%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EBetreff%3A%20Frage%20zur%20Funktion%20%E2%80%9EZeilen%20hinzuf%C3%BCgen%E2%80%9C.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-48875%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1855%22%20target%3D%22_blank%22%3E%40Justin_Chilton%3C%2FA%3E%20Netter%20Tipp!%20Das%20werde%20ich%20in%20meinem%20Werkzeugkasten%20behalten.%3C%2FP%3E%0A%3CP%3EDanke%2C%3C%2FP%3E%0A%3CP%3E-B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-48873%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EBetreff%3A%20Frage%20zur%20Funktion%20%E2%80%9EZeilen%20hinzuf%C3%BCgen%E2%80%9C.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-48873%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EZus%C3%A4tzlich%20zu%20dem%2C%20was%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F281%22%20target%3D%22_blank%22%3E%40vladbondarenko0%3C%2FA%3E%20bereits%20bereitgestellt%20hat%2C%20k%C3%B6nnen%20Sie%20die%20JMP%2013-Datentabellensubskription%20verwenden%2C%20um%20alle%20Zeilenwerte%20auf%20einmal%20festzulegen%2C%20nachdem%20Sie%20die%20Zeile%20bereits%20an%20der%20gew%C3%BCnschten%20Stelle%20hinzugef%C3%BCgt%20haben.%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edt%20%26lt%3B%26lt%3B%20Add%20Rows(1%2C1)%3B%0Adt%5B%5B2%5D%2C%7Bname%2Cage%2Csex%2Cheight%2Cweight%7D%5D%20%3D%20%7B%7B%22Mark%22%2C%2014%2C%20%22M%22%2C%2061%2C%20124%7D%7D%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EWie%20aus%20der%20Dokumentation%20hervorgeht%2C%20wird%20die%20Angabe%20einer%20Zeilenposition%20in%20der%20Nachricht%20%E2%80%9EZeilen%20hinzuf%C3%BCgen%E2%80%9C%20bei%20Verwendung%20des%20Wertelistenansatzes%20nicht%20unterst%C3%BCtzt.%20Die%20Zeilenindexposition%20wird%20nur%20beim%20Einf%C3%BCgen%20von%20%3CEM%3En%3C%2FEM%3E%20leeren%20Zeilen%20verwendet.%20Schicken%20Sie%20uns%20gerne%20eine%20E-Mail%20an%20%3CA%20href%3D%22http%3A%2F%2Fmailto%3Asupport%40jmp.com%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Esupport%40jmp.com%3C%2FA%3E%20und%20wir%20k%C3%B6nnen%20dies%20als%20Funktionsanfrage%20zur%20Ber%C3%BCcksichtigung%20in%20einer%20zuk%C3%BCnftigen%20Version%20von%20JMP%20hinzuf%C3%BCgen.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-48871%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EBetreff%3A%20Frage%20zur%20Funktion%20%E2%80%9EZeilen%20hinzuf%C3%BCgen%E2%80%9C.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-48871%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%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%3C%2FP%3E%0A%3CP%3EDer%20dokumentierte%20Code%20funktioniert%20korrekt.%20Ich%20denke%2C%20was%20Sie%20%C3%BCbersehen%2C%20ist%2C%20dass%20die%20Funktion%20%E2%80%9EAdd%20Rows()%E2%80%9C%20zwei%20verschiedene%20Codestrukturen%20hat%20und%20dass%20das%20Mischen%20der%20beiden%20Strukturen%20nicht%20funktioniert.%3C%2FP%3E%0A%3CP%3EAdd%20Rows(1)%20oder%20Add%20Rows(1%2C3)%20ist%20eine%20der%20Syntaxstrukturen%3C%2FP%3E%0A%3CP%3EUnd%3C%2FP%3E%0A%3CP%3EAdd%20Rows(%7Blist%7D)%20oder%20Add%20Rows(%7BList%20of%20Lists%7D)%20ist%20die%20zweite%20Struktur%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3EMeine%20Tests%20des%20Codes%20erlauben%20keine%20Vermischung%20der%20beiden%20Syntaxstrukturen%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-48870%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EBetreff%3A%20Frage%20zur%20Funktion%20%E2%80%9EZeilen%20hinzuf%C3%BCgen%E2%80%9C.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-48870%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EIch%20sch%C3%A4tze%20die%20Idee%20%40vladbindarenko0%2C%20aber%20ich%20m%C3%B6chte%20verstehen%2C%20warum%20die%20dokumentierte%20Methode%20nicht%20funktioniert%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-48869%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EBetreff%3A%20Frage%20zur%20Funktion%20%E2%80%9EZeilen%20hinzuf%C3%BCgen%E2%80%9C.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-48869%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EIch%20wei%C3%9F%20nicht%2C%20ob%20es%20der%20beste%20Weg%20ist%2C%20aber%20es%20funktioniert%3A%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EOpen(%20%22%24SAMPLE_DATA%2FBig%20Class.jmp%22%20)%3B%20%2F%2F%20Open%20Sample%20Data%0ARowStyle1%20%3D%20%7B%3Aname%20%3D%20%22Mark%22%2C%3Aage%20%3D%2012%2C%3Asex%20%3D%20%22M%22%2C%3Aheight%20%3D%2080%2C%3Aweight%20%3D%20102%7D%3B%20%2F%2F%20Define%20Row%20To%20Add%0ARowIndex%20%3D%2010%20%3B%20%2F%2F%20Define%20position%20to%20add%20desired%20row%20%E3%80%80%0Adt1%20%26lt%3B%26lt%3B%20add%20Rows(RowStyle1%20)%3B%0Adt1%20%26lt%3B%26lt%3B%20Select%20Rows(n%20rows(dt1))%3B%0Adt1%20%26lt%3B%26lt%3B%20Move%20Rows(After(RowIndex))%3B%20%2F%2F%20Add%20Rows%20.%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3E%3CFONT%20face%3D%22Consolas%22%20size%3D%222%22%20color%3D%22%23008000%22%3E%20%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
uday_guntupalli
Level VIII

Add Rows Function Question

All, 

        I am using JMP 13.1.0 on a Windows 7 machine. 

        I am trying to add rows to a data table after a specific row. 

       According to the documentation (http://www.jmp.com/support/help/13-2/Add_Rows_2.shtml)  that I am referencing, the correct way to do that is : 

  

dt << Add Rows( 3, 10 ); /* add 3 rows after the 10th row, moving the 11th and lower rows farther down */

        Now , I expand on that to do this : 

 

dt1 = Open( "$SAMPLE_DATA/Big Class.jmp" ); // Open Sample Data 

RowStyle1 = {:name = "Mark",:age = 12,:sex = "M",:height = 80,:weight = 102}; // Define Row To Add 

RowIndex = 1 ; // Define position to add desired row 

dt1 << Add Rows(RowStyle1,RowIndex); // Add Rows . 

The result of this piece of code is shown in the screeshot below : 

 

image.png

Shouldn't the row be added after row 1 - essentially moving rows 2 through 40 down ? 
Can someone point out what i am doing wrong here? 

 

Also - would like to add one more question on Add Rows() : 

RowStyle2 = {:name = "Mark",:age = 12,:sex = "M",:height = 80,:weight = :weight[1]/2}; // Define Row To Add 

If instead of a pre-defined value, I wanted to use a dynamic value like shown above RowStyle2 vs RowStyle1 - should I be using expressions? If yes - please provide an example. 

Best
Uday
2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: Add Rows Function Question

I do not know if it is the best way, but it works:

Open( "$SAMPLE_DATA/Big Class.jmp" ); // Open Sample Data
RowStyle1 = {:name = "Mark",:age = 12,:sex = "M",:height = 80,:weight = 102}; // Define Row To Add
RowIndex = 10 ; // Define position to add desired row  
dt1 << add Rows(RowStyle1 );
dt1 << Select Rows(n rows(dt1));
dt1 << Move Rows(After(RowIndex)); // Add Rows .

 

 

View solution in original post

Re: Add Rows Function Question

In addition to what @vladbondarenko0 already provided, you can use JMP 13 data table subscripting to set all the row values at once after you already added the row where you want.

dt << Add Rows(1,1);
dt[[2],{name,age,sex,height,weight}] = {{"Mark", 14, "M", 61, 124}};

Looking at the documentation, specifying a row position in the Add Rows message is not supported when using the list of values approach. The row index position is only used when inserting n empty rows. Feel free to shoot us an email at support@jmp.com and we can add this as a feature request for consideration in a future release of JMP.

Justin

View solution in original post

8 REPLIES 8

Re: Add Rows Function Question

I do not know if it is the best way, but it works:

Open( "$SAMPLE_DATA/Big Class.jmp" ); // Open Sample Data
RowStyle1 = {:name = "Mark",:age = 12,:sex = "M",:height = 80,:weight = 102}; // Define Row To Add
RowIndex = 10 ; // Define position to add desired row  
dt1 << add Rows(RowStyle1 );
dt1 << Select Rows(n rows(dt1));
dt1 << Move Rows(After(RowIndex)); // Add Rows .

 

 

uday_guntupalli
Level VIII

Re: Add Rows Function Question

Appreciate the idea @vladbindarenko0 but I want to understand why the documented method is not working
Best
Uday
txnelson
Super User

Re: Add Rows Function Question

@uday_guntupalli

The documented code works correctly.  I think what you are missing, is that the Add Rows() function has 2 different code structures, and that mixing the 2 structures does not work.

Add Rows(1) or Add Rows(1,3) is one of the syntax structures

and

Add Rows({list}) or Add Rows({List of Lists}) is the second structure

 

My testing of the code does not permit the mixing of the 2 syntax structures

Jim

Re: Add Rows Function Question

In addition to what @vladbondarenko0 already provided, you can use JMP 13 data table subscripting to set all the row values at once after you already added the row where you want.

dt << Add Rows(1,1);
dt[[2],{name,age,sex,height,weight}] = {{"Mark", 14, "M", 61, 124}};

Looking at the documentation, specifying a row position in the Add Rows message is not supported when using the list of values approach. The row index position is only used when inserting n empty rows. Feel free to shoot us an email at support@jmp.com and we can add this as a feature request for consideration in a future release of JMP.

Justin
Byron_JMP
Staff

Re: Add Rows Function Question

@Justin_Chilton  Nice Tip!  I'm going to keep that one in my tool box.

Thanks,

-B

JMP Systems Engineer, Health and Life Sciences (Pharma)

Re: Add Rows Function Question

@Byron_JMP, you might want to check out @Craige_Hales' blog Data table subscripting for more cool examples like that.

Justin
HauNguyen
Level I

Re: Add Rows Function Question

Hi All.

i have a table like this:

 

Module    MONTH     COST

STHI           1             15

STHI           2             20

STHI           3             25

STHI           5             30

OLB           1              44

OLB           2             54

OLB           4              33

OLB          5               22

 

as you can see, month colluum is missing some months in a row. and i also want to cumulative sum the cost coluum base on module into a new coluum, the new table will be like this:

 

Module    Month    cost      totalcost

STHI         1           15           15

STHI         2           20           35

STHI         3           25           60

STHI         4           0             60

STHI        5            30           90

OLB         1            44          44

OLB         2            54          98

OLB         3             0           98

OLB         4             33        131

OLB         5            22         153

 

is there any way to transfer to the table like this, could you please to help me. Thank you so much

txnelson
Super User

Re: Add Rows Function Question

create a new column and give it the formula

col cumulative sum( :Cost )
Jim

Recommended Articles