cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
%3CLINGO-SUB%20id%3D%22lingo-sub-46411%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%EB%AA%A9%EB%A1%9D%EC%9D%98%20%EA%B0%92%EA%B3%BC%20%EC%9D%BC%EC%B9%98%ED%95%98%EB%8A%94%20%ED%96%89%20%EC%84%A0%ED%83%9D%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-46411%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CDIV%20class%3D%22lia-message-template-problem-zone%22%3E%0A%3CH2%20id%3D%22toc-hId--1330392654%22%20id%3D%22toc-hId-1619652006%22%20id%3D%22toc-hId-1619652006%22%3E%EB%AC%B8%EC%A0%9C%3C%2FH2%3E%0A%3CP%3E%EC%82%AC%EC%9A%A9%EC%9E%90%EC%97%90%EA%B2%8C%20%EC%84%A0%ED%83%9D%ED%95%98%EB%9D%BC%EB%8A%94%20%EB%A9%94%EC%8B%9C%EC%A7%80%EB%A5%BC%20%ED%91%9C%EC%8B%9C%ED%95%9C%EB%8B%A4%EA%B3%A0%20%EA%B0%80%EC%A0%95%ED%95%B4%20%EB%B3%B4%EA%B2%A0%EC%8A%B5%EB%8B%88%EB%8B%A4.%20%EC%82%AC%EC%9A%A9%EC%9E%90%EB%A1%9C%EB%B6%80%ED%84%B0%20%EA%B0%92%EC%9D%84%20%EA%B2%80%EC%83%89%ED%95%98%EB%A9%B4%20%EC%9D%BC%EB%B0%98%EC%A0%81%EC%9C%BC%EB%A1%9C%20%EB%AA%A9%EB%A1%9D%EC%97%90%20%EC%A0%80%EC%9E%A5%EB%90%A9%EB%8B%88%EB%8B%A4.%EC%9D%B4%EC%A0%9C%20%EB%AA%A9%EB%A1%9D%EC%9D%98%20%EA%B0%92%EA%B3%BC%20%EC%9D%BC%EC%B9%98%ED%95%98%EB%8A%94%20%EB%8D%B0%EC%9D%B4%ED%84%B0%EB%A5%BC%20%EC%84%A0%ED%83%9D%ED%95%B4%EC%95%BC%20%ED%95%A9%EB%8B%88%EB%8B%A4.%3C%2FP%3E%0A%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-message-template-diagnosis-zone%22%3E%0A%3CH2%20id%3D%22toc-hId--442888973%22%20id%3D%22toc-hId--932504955%22%20id%3D%22toc-hId--932504955%22%3E%ED%95%B4%EA%B2%B0%EC%B1%85%3C%2FH2%3E%0A%3CP%3E%3CSPAN%3E%EB%8B%A4%EC%9D%8C%20%EC%98%88%EC%97%90%EC%84%9C%EB%8A%94%20JSL%20%EB%AA%A9%EB%A1%9D%EC%97%90%20%EC%A0%80%EC%9E%A5%EB%90%9C%20%EA%B0%92%EC%9D%B4%20%ED%8F%AC%ED%95%A8%EB%90%9C%20%EB%8D%B0%EC%9D%B4%ED%84%B0%20%ED%85%8C%EC%9D%B4%EB%B8%94%EC%9D%98%20%ED%96%89%EC%9D%84%20%EC%84%A0%ED%83%9D%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95%EC%9D%84%20%EB%B3%B4%EC%97%AC%EC%A4%8D%EB%8B%88%EB%8B%A4.%20%EC%88%AB%EC%9E%90%20%EA%B0%92%EC%9D%B4%EB%82%98%20%EB%AC%B8%EC%9E%90%EC%97%B4%EC%9D%84%20%ED%8F%AC%ED%95%A8%ED%95%98%EB%8A%94%20%EB%AA%A9%EB%A1%9D%EC%9D%84%20%EC%82%AC%EC%9A%A9%ED%95%A0%20%EC%88%98%20%EC%9E%88%EC%9C%BC%EB%A9%B0%20%EC%95%84%EB%9E%98%EC%97%90%20%EB%82%98%EC%99%80%20%EC%9E%88%EC%8A%B5%EB%8B%88%EB%8B%A4.%EC%9E%90%EC%84%B8%ED%95%9C%20%EB%82%B4%EC%9A%A9%EC%9D%80%20%ED%8F%AC%ED%95%A8%EB%90%9C%20%EB%8C%93%EA%B8%80%EC%9D%84%20%EC%B0%B8%EC%A1%B0%ED%95%98%EC%84%B8%EC%9A%94.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%2F*%20Open%20a%20sample%20data%20table.%20*%2F%0Adt%20%3D%20Open(%20%22%24SAMPLE_DATA%5CBig%20Class.jmp%22%20)%3B%0A%0A%2F*%20Create%20a%20list%20of%20ages.%20*%2F%0AmyList%20%3D%20%7B9%2C%2012%2C%2015%2C%2017%2C%2018%7D%3B%0A%0A%2F*%20Select%20all%20rows%20which%20have%20an%20age%20that%20is%20in%20the%20list.%20*%2F%0Adt%20%26lt%3B%26lt%3B%20Select%20Where(%20Contains(%20myList%2C%20%3Aage%20)%20)%3B%0A%0AWait(%202%20)%3B%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20For%20demonstration%20purposes%0A%0A%2F*%20Create%20a%20list%20of%20student%20names.%20*%2F%0AmyStudents%20%3D%20%7B%22HENRY%22%2C%20%22ROBERT%22%2C%20%22BARBARA%22%2C%20%22SALLY%22%2C%20%22MARION%22%7D%3B%0A%0A%2F*%20Select%20all%20rows%20which%20have%20any%20of%20the%20names%20in%20the%20list.%20*%2F%0Adt%20%26lt%3B%26lt%3B%20Select%20Where(%20Contains(%20myStudents%2C%20%3Aname%20)%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-message-template-solution-zone%22%3E%0A%3CH2%20id%3D%22toc-hId-444614708%22%20id%3D%22toc-hId-810305380%22%20id%3D%22toc-hId-810305380%22%3E%EB%85%BC%EC%9D%98%3C%2FH2%3E%0A%3CP%3E%EC%9D%B4%20%EC%98%88%EC%97%90%EC%84%9C%EB%8A%94%20Contains()%20%ED%95%A8%EC%88%98%EB%A5%BC%20%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC%20%EA%B0%81%20%ED%96%89%EC%9D%84%20%EA%B0%92%20%EB%AA%A9%EB%A1%9D%EA%B3%BC%20%EB%B9%84%EA%B5%90%ED%95%A9%EB%8B%88%EB%8B%A4.%3C%2FP%3E%3CSPAN%3ESelect%20Where()%EB%A5%BC%20%EC%82%AC%EC%9A%A9%ED%95%98%EB%8A%94%20%EB%8D%94%20%EB%A7%8E%EC%9D%80%20%EC%98%88%EB%8A%94%20%EB%8B%A4%EC%9D%8C%EC%97%90%EC%84%9C%20%EC%B0%BE%EC%9D%84%20%EC%88%98%20%EC%9E%88%EC%8A%B5%EB%8B%88%EB%8B%A4.%3C%2FSPAN%3E%3CA%20href%3D%22http%3A%2F%2Fwww.jmp.com%2Fsupport%2Fhelp%2F13-2%2FSelect_Rows_2.shtml%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3E%20%ED%96%89%20%EC%84%A0%ED%83%9D%3C%2FA%3E%3CSPAN%3E%20JMP%20%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8C%85%20%EA%B0%80%EC%9D%B4%EB%93%9C%20%EC%84%B9%EC%85%98%EC%9D%84%20%EC%B0%B8%EC%A1%B0%ED%95%98%EC%84%B8%EC%9A%94.%3C%2FSPAN%3E%3CBR%20%2F%3E%3CH2%20id%3D%22toc-hId-1332118389%22%20id%3D%22toc-hId--1741851581%22%20id%3D%22toc-hId--1741851581%22%3E%EB%98%90%ED%95%9C%EB%B3%B4%EC%8B%AD%EC%8B%9C%EC%98%A4%3C%2FH2%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FJSL-Cookbook%2FSelect-rows-from-the-currently-selected-rows%2Fta-p%2F46409%22%20target%3D%22_blank%22%3E%ED%98%84%EC%9E%AC%20%EC%84%A0%ED%83%9D%EB%90%9C%20%ED%96%89%EC%97%90%EC%84%9C%20%ED%96%89%20%EC%84%A0%ED%83%9D%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FJSL-Cookbook%2FSelect-rows-based-upon-multiple-conditions%2Fta-p%2F46404%22%20target%3D%22_blank%22%3E%EC%97%AC%EB%9F%AC%20%EC%A1%B0%EA%B1%B4%EC%97%90%20%EB%94%B0%EB%9D%BC%20%ED%96%89%20%EC%84%A0%ED%83%9D%3C%2FA%3E%3C%2FP%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-709889%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%EB%AA%A9%EB%A1%9D%EC%9D%98%20%EA%B0%92%EA%B3%BC%20%EC%9D%BC%EC%B9%98%ED%95%98%EB%8A%94%20%ED%96%89%EC%9D%84%20%EC%84%A0%ED%83%9D%ED%95%98%EC%84%B8%EC%9A%94.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-709889%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%EC%95%84%20%EC%A2%8B%EC%95%84%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Acara_con_una_leve_sonrisa%3A%22%3E%3C%2FLI-EMOJI%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%20%ED%8F%AC%ED%95%A8%ED%95%98%EB%8A%94%20%EA%B2%83%EC%9D%B4%20%EB%8D%94%20%EB%8A%90%EB%A6%AC%EB%8B%A4%EB%8A%94%20%EA%B2%83%EC%9D%B4%20%EB%91%90%EB%A0%A4%EC%9B%A0%EC%8A%B5%EB%8B%88%EB%8B%A4.%20%ED%95%98%EC%A7%80%EB%A7%8C%20%EC%8B%A4%EC%A0%9C%EB%A1%9C%20...%3CBR%20%2F%3E%20%EB%82%98%20%EC%9E%90%EC%8B%A0%EC%97%90%EA%B2%8C%20%EB%A9%94%EB%AA%A8%3A%20%EC%82%AC%EC%9A%A9%3CSTRONG%3E%20%ED%8F%AC%ED%95%A8%3C%2FSTRONG%3E%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Acara_con_una_leve_sonrisa%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22hogi_0-1702737609134.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22hogi_0-1702737609134.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22hogi_0-1702737609134.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F59757i76E3893397E24BF0%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22hogi_0-1702737609134.png%22%20alt%3D%22hogi_0-1702737609134.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3E%EB%8D%94%EB%B3%B4%EA%B8%B0...%3C%2FA%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0ATry(close(dt%2C%20noSave))%3B%0Adt%20%3D%20Open(%20%22%24SAMPLE_DATA%2FBig%20Class.jmp%22%20)%3B%0A%0Aresults%20%3D%20New%20Table(%20%22Untitled%22%2C%0A%20Add%20Rows(%200%20)%2C%0A%20New%20Column(%20%22rows%22%20)%2C%0A%20New%20Column(%20%22t_contains_string%22%20)%2C%0A%20New%20Column(%20%22t_any_loc_string%22%20)%2C%0A%20New%20Column(%20%22t_contains_number%22%20)%2C%0A%20New%20Column(%20%22t_any_loc_number%22%20)%2C%0A%20New%20Column(%20%22t_any_number%22%20)%0A)%3B%0A%0Adt%20%26lt%3B%26lt%3B%20New%20Column(%20%22nameID%22%2C%20Formula(%20Row()%20)%20)%3B%0Adt%3AnameID%20%26lt%3B%26lt%3B%20delete%20formula%3B%0A%0AFor(%20i%20%3D%201%2C%20i%20%26lt%3B%3D%2020%2C%20i%2B%2B%2C%0A%0A%20t0%20%3D%20HP%20Time()%3B%0A%20dt%20%26lt%3B%26lt%3B%20Select%20Where(%20Contains(%20%7B%22JANE%22%2C%20%22DAVID%22%2C%20%22PATTY%22%7D%2C%20%3Aname%20)%20)%3B%0A%20t1%20%3D%20((HP%20Time()%20-%20t0)%20%2F%201000000)%3B%0A%0A%20t0%20%3D%20HP%20Time()%3B%0A%20dt%20%26lt%3B%26lt%3B%20Select%20Where(%20Any(%20Loc(%20%7B%22JANE%22%2C%20%22DAVID%22%2C%20%22PATTY%22%7D%2C%20%3Aname%20)%20)%20)%3B%0A%20t2%20%3D%20((HP%20Time()%20-%20t0)%20%2F%201000000)%3B%0A%0A%20t0%20%3D%20HP%20Time()%3B%0A%20dt%20%26lt%3B%26lt%3B%20Select%20Where(%20Contains(%20%7B3%2C%2015%2C%2020%7D%2C%20%3AnameID%20)%20)%3B%0A%20t3%20%3D%20((HP%20Time()%20-%20t0)%20%2F%201000000)%3B%0A%20%0A%20t0%20%3D%20HP%20Time()%3B%0A%20dt%20%26lt%3B%26lt%3B%20Select%20Where(%20Any(%20Loc(%20%5B3%2015%2020%5D%2C%20%3AnameID%20)%20)%20)%3B%0A%20t4%20%3D%20((HP%20Time()%20-%20t0)%20%2F%201000000)%3B%0A%0A%20t0%20%3D%20HP%20Time()%3B%0A%20dt%20%26lt%3B%26lt%3B%20Select%20Where(%20Any(%20%3AnameID%20%3D%3D%20%5B3%2015%2020%5D%20)%20)%3B%0A%20t5%20%3D%20((HP%20Time()%20-%20t0)%20%2F%201000000)%3B%0A%0A%20results%20%26lt%3B%26lt%3B%20add%20rows(%20%7B%3Arows%20%3D%20N%20Rows(%20dt%20)%2C%3At_contains_string%20%3D%20t1%2C%20%3At_any_loc_string%20%3D%20t2%2C%20%3At_contains_number%20%3D%20t3%2C%20%3At_any_loc_number%20%3D%20t4%2C%20%3At_any_number%20%3D%20t5%7D%20)%3B%0A%20dt%20%3D%20dt%20%26lt%3B%26lt%3B%20concatenate(%20%7Bdt%7D%2C%20Append%20to%20first%20table%20)%3B%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3E%EC%9D%B4%EB%A6%84%EC%9D%98%20%EA%B8%B0%EB%B3%B8%EA%B0%92%EC%9D%80%20%EC%97%AC%EA%B8%B0%EC%97%90%20%EC%9E%88%EC%8A%B5%EB%8B%88%EB%8B%A4(%201%20)%3B%20Try(close(dt%2C%20noSave))%3B%20dt%20%3D%20Open(%20%22%24SAMPLE_DATA%2FBig%20Class.jmp%22%20)%3B%20%EA%B2%B0%EA%B3%BC%20%3D%20%EC%83%88%20%ED%85%8C%EC%9D%B4%EB%B8%94(%20%22%EC%A0%9C%EB%AA%A9%20%EC%97%86%EC%9D%8C%22%2C%20%ED%96%89%20%EC%B6%94%EA%B0%80(%200%20)%2C%20%EC%83%88%20%EC%97%B4(%20%22rows%22%20)%2C%20%EC%83%88%20%EC%97%B4(%20%22t_contains_string%22%20)%2C%20%EC%83%88%20%EC%97%B4(%20%22t_any_loc_string%22%20)%2C%20%EC%83%88%20%EC%97%B4(%20%22t_contains_number%22%20)%2C%20%EC%83%88%20%EC%97%B4(%20%22t_any_loc_number%22%20)%2C%20%EC%83%88%20%EC%97%B4(%20%22t_any_number%22%20)%20)%3B%20dt%20%26lt%3B%26lt%3B%20%EC%83%88%20%EC%97%B4(%20%22nameID%22%2C%20Formula(%20Row()%20)%20)%3B%20dt%3AnameID%20%26lt%3B%26lt%3B%20%EC%88%98%EC%8B%9D%20%EC%82%AD%EC%A0%9C%3B%20For(%20i%20%3D%201%2C%20i%20%26lt%3B%3D%2020%2C%20i%2B%2B%2C%20t0%20%3D%20HP%20Time()%3B%20dt%20%26lt%3B%26lt%3B%20Select%20Where(%20Contains(%20%7B%22JANE%22%2C%20%22DAVID%22%2C%20%22PATTY%22%7D%2C%20%3Aname%20)%20)%3B%20t1%20%3D%20(%20(HP%20%EC%8B%9C%EA%B0%84()%20-%20t0)%20%2F%201000000)%3B%20t0%20%3D%20HP%20%EC%8B%9C%EA%B0%84()%3B%20dt%20%26lt%3B%26lt%3B%20Select%20Where(%20Any(%20Loc(%20%7B%22JANE%22%2C%20%22DAVID%22%2C%20%22PATTY%22%7D%2C%20%3Aname%20)%20)%20)%3B%20t2%20%3D%20((HP%20%EC%8B%9C%EA%B0%84()%20-%20t0)%20%2F%201000000)%3B%20t0%20%3D%20HP%20%EC%8B%9C%EA%B0%84()%3B%20dt%20%26lt%3B%26lt%3B%20%EC%9C%84%EC%B9%98%20%EC%84%A0%ED%83%9D(%20Contains(%20%7B3%2C%2015%2C%2020%7D%2C%20%3AnameID%20)%20)%3B%20t3%20%3D%20((HP%20%EC%8B%9C%EA%B0%84()%20-%20t0)%20%2F%201000000)%3B%20t0%20%3D%20HP%20%EC%8B%9C%EA%B0%84()%3B%20dt%20%26lt%3B%26lt%3B%20Select%20Where(%20Any(%20Loc(%20%5B3%2015%2020%5D%2C%20%3AnameID%20)%20)%20)%3B%20t4%20%3D%20((HP%20Time()%20-%20t0)%20%2F%201000000)%20%3B%20t0%20%3D%20HP%20%EC%8B%9C%EA%B0%84()%3B%20dt%20%26lt%3B%26lt%3B%20Select%20Where(%20Any(%20%3AnameID%20%3D%3D%20%5B3%2015%2020%5D%20)%20)%3B%20t5%20%3D%20((HP%20Time()%20-%20t0)%20%2F%201000000)%3B%20%EA%B2%B0%EA%B3%BC%20%26lt%3B%26lt%3B%20%ED%96%89%20%EC%B6%94%EA%B0%80(%20%7B%20%3Arows%20%3D%20N%20%ED%96%89(%20dt%20)%2C%3At_contains_string%20%3D%20t1%2C%20%3At_any_loc_string%20%3D%20t2%2C%20%3At_contains_number%20%3D%20t3%2C%20%3At_any_loc_number%20%3D%20t4%2C%20%3At_any_number%20%3D%20t5%7D%20)%3B%20dt%20%3D%20dt%20%26lt%3B%26lt%3B%20%EC%97%B0%EA%B2%B0(%20%7Bdt%7D%2C%20%EC%B2%AB%20%EB%B2%88%EC%A7%B8%EC%97%90%20%EC%B6%94%EA%B0%80%20%ED%85%8C%EC%9D%B4%EB%B8%94%20)%3B%20)%3B%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-709882%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%EB%AA%A9%EB%A1%9D%EC%9D%98%20%EA%B0%92%EA%B3%BC%20%EC%9D%BC%EC%B9%98%ED%95%98%EB%8A%94%20%ED%96%89%EC%9D%84%20%EC%84%A0%ED%83%9D%ED%95%98%EC%84%B8%EC%9A%94.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-709882%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%EB%8D%94%20%EB%B3%B5%EC%9E%A1%ED%95%9C%20%EA%B5%AC%EB%AC%B8%EC%9D%84%20%EC%82%AC%EC%9A%A9%ED%95%B4%EC%95%BC%20%ED%95%98%EB%8A%94%20%ED%8A%B9%EB%B3%84%ED%95%9C%20%EC%9A%94%EA%B5%AC%20%EC%82%AC%ED%95%AD%EC%9D%B4%20%EC%9E%88%EB%82%98%EC%9A%94%3F%20Loc%EC%9D%84%20Any%EC%99%80%20%ED%95%A8%EA%BB%98%20%EC%82%AC%EC%9A%A9%ED%95%A0%20%EC%88%98%20%EC%9E%88%EC%8A%B5%EB%8B%88%EB%8B%A4.%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%0A%0Adt%20%3D%20Open(%22%24SAMPLE_DATA%5CBig%20Class.jmp%22)%3B%0Adt%20%26lt%3B%26lt%3B%20Select%20Where(Any(Loc(%7B%22JANE%22%2C%20%22DAVID%22%2C%20%22PATTY%22%7D%2C%20%3Aname)))%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-709870%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%EB%AA%A9%EB%A1%9D%EC%9D%98%20%EA%B0%92%EA%B3%BC%20%EC%9D%BC%EC%B9%98%ED%95%98%EB%8A%94%20%ED%96%89%EC%9D%84%20%EC%84%A0%ED%83%9D%ED%95%98%EC%84%B8%EC%9A%94.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-709870%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%EA%B0%99%EC%9D%80%20%EA%B2%B0%EA%B3%BC%EC%A3%A0%2C%20%EA%B7%B8%EB%A0%87%EC%A3%A0.%3CBR%20%2F%3E%20%ED%95%98%EC%A7%80%EB%A7%8C%20%EA%B5%AC%EB%AC%B8%EC%9D%B4%20%EB%8B%A4%EB%A6%85%EB%8B%88%EB%8B%A4.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-709869%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%EB%AA%A9%EB%A1%9D%EC%9D%98%20%EA%B0%92%EA%B3%BC%20%EC%9D%BC%EC%B9%98%ED%95%98%EB%8A%94%20%ED%96%89%EC%9D%84%20%EC%84%A0%ED%83%9D%ED%95%98%EC%84%B8%EC%9A%94.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-709869%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%EA%B7%B8%EA%B2%83%EC%9D%80%20%EB%8B%B9%EC%8B%A0%EC%9D%B4%20Contains()%EB%A5%BC%20%EC%82%AC%EC%9A%A9%ED%95%98%EB%8A%94%20%EA%B2%83%EC%9D%B4%20%EC%95%84%EB%8B%8C%EA%B0%80%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-709532%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%EB%AA%A9%EB%A1%9D%EC%9D%98%20%EA%B0%92%EA%B3%BC%20%EC%9D%BC%EC%B9%98%ED%95%98%EB%8A%94%20%ED%96%89%EC%9D%84%20%EC%84%A0%ED%83%9D%ED%95%98%EC%84%B8%EC%9A%94.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-709532%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edt%20%26lt%3B%26lt%3B%20Select%20Where(%20Any(%20Row()%20%3D%3D%20Index(%203%2C%205%20)%20)%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%EB%A9%8B%EC%A7%80%EB%8B%A4%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Acara_con_una_leve_sonrisa%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%EB%B9%84%EC%8A%B7%ED%95%9C%20%EA%B2%8C%20%EC%9E%88%EB%82%98%EC%9A%94%3F%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edt%20%26lt%3B%26lt%3B%20Select%20Where(%20Any(%20%3Aname%20%3D%3D%20%7B%22JANE%22%2C%20%22DAVID%22%2C%22PATTY%22%7D)%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
Select rows that match any value in a list

Problem

Suppose you prompt a user to make a selection. When you retrieve the values from the user, typically they are stored in a list.  Now you need to select the data that matches the values in the list.

Solution

The following example demonstrates how you can select rows in a data table that contain any value stored in a JSL list. Lists containing either numeric values or character strings can be used and are shown below.  See the embedded comments for details.

/* Open a sample data table. */
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );

/* Create a list of ages. */
myList = {9, 12, 15, 17, 18};

/* Select all rows which have an age that is in the list. */
dt << Select Where( Contains( myList, :age ) );

Wait( 2 );           // For demonstration purposes

/* Create a list of student names. */
myStudents = {"HENRY", "ROBERT", "BARBARA", "SALLY", "MARION"};

/* Select all rows which have any of the names in the list. */
dt << Select Where( Contains( myStudents, :name ) );

Discussion

In these examples, the Contains() function is used to compare each row to the list of values.

Many more examples of using Select Where() can be found in the Select Rows section of the JMP Scripting Guide.

See Also

Select rows from the currently selected rows

Select rows based upon multiple conditions

Comments
hogi
dt << Select Where( Any( Row() == Index( 3, 5 ) ) );

is cool

 

is there something similar for

dt << Select Where( Any( :name == {"JANE", "DAVID","PATTY"}) );

?

 

jthi

Isn't that what you would use Contains() for?

hogi

same result, yes.
but different syntax.

jthi

Is there some specific need to use more complex syntax? You could use Loc with Any

Names Default To Here(1);

dt = Open("$SAMPLE_DATA\Big Class.jmp");
dt << Select Where(Any(Loc({"JANE", "DAVID", "PATTY"}, :name)));

 

hogi

Ah, nice

I feared that contains is slower. but actually ...
note to myself: use contains 

hogi_0-1702737609134.png

 

 

View more...
Names Default To Here( 1 );
Try(close(dt, noSave));
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

results = New Table( "Untitled",
	Add Rows( 0 ),
	New Column( "rows" ),
	New Column( "t_contains_string" ),
	New Column( "t_any_loc_string" ),
	New Column( "t_contains_number" ),
	New Column( "t_any_loc_number" ),
	New Column( "t_any_number" )
);

dt << New Column( "nameID", Formula( Row() ) );
dt:nameID << delete formula;

For( i = 1, i <= 20, i++,

	t0 = HP Time();
	dt << Select Where( Contains( {"JANE", "DAVID", "PATTY"}, :name ) );
	t1 = ((HP Time() - t0) / 1000000);

	t0 = HP Time();
	dt << Select Where( Any( Loc( {"JANE", "DAVID", "PATTY"}, :name ) ) );
	t2 = ((HP Time() - t0) / 1000000);

	t0 = HP Time();
	dt << Select Where( Contains( {3, 15, 20}, :nameID ) );
	t3 = ((HP Time() - t0) / 1000000);
	
	t0 = HP Time();
	dt << Select Where( Any( Loc( [3 15 20], :nameID ) ) );
	t4 = ((HP Time() - t0) / 1000000);

	t0 = HP Time();
	dt << Select Where( Any( :nameID == [3 15 20] ) );
	t5 = ((HP Time() - t0) / 1000000);

	results << add rows( {:rows = N Rows( dt ),:t_contains_string = t1, :t_any_loc_string = t2, :t_contains_number = t3, :t_any_loc_number = t4, :t_any_number = t5} );
	dt = dt << concatenate( {dt}, Append to first table );
);

 

JSL Cookbook

If you’re looking for a code snippet or design pattern that performs a common task for your JSL project, the JSL Cookbook is for you.

This knowledge base contains building blocks of JSL code that you can use to reduce the amount of coding you have to do yourself.

It's also a great place to learn from the experts how to use JSL in new ways, with best practices.