cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
%3CLINGO-SUB%20id%3D%22lingo-sub-572468%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E6%A3%80%E6%9F%A5%E5%88%97%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-572468%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%3C%2FP%3E%3CP%3E%E6%88%91%E6%83%B3%E5%88%9B%E5%BB%BA%E4%B8%80%E4%B8%AA%E6%96%B0%E4%B8%93%E6%A0%8F%EF%BC%8C%E5%9C%A8%E6%AD%A4%E4%B9%8B%E5%89%8D%EF%BC%9A%3C%2FP%3E%3CP%3E%E8%AF%A2%E9%97%AE%E6%95%B0%E6%8D%AE%E8%A1%A8%E8%AF%A5%E5%88%97%E6%98%AF%E5%90%A6%E5%B7%B2%E5%AD%98%E5%9C%A8%E3%80%82%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E6%98%AF%E5%90%A6%E6%9C%89%E4%B8%80%E7%A7%8D%E2%80%9C%E6%9C%80%E4%BD%B3%E2%80%9D%E6%96%B9%E5%BC%8F%E5%8F%AF%E4%BB%A5%E4%B8%8E%E5%85%AC%E5%8F%B8%E7%9A%84%E5%85%B6%E4%BB%96%E5%90%8C%E4%BA%8B%E5%85%B1%E4%BA%AB%E4%BB%A3%E7%A0%81%EF%BC%9F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscussions%2FCheck-column-name-if-existing%2Fm-p%2F311971%23U311971%22%20class%3D%22lia-mention-container-editor-message%20lia-img-icon-forum-thread%20lia-fa-icon%20lia-fa-forum%20lia-fa-thread%20lia-fa%22%20target%3D%22_blank%22%3E%E6%A3%80%E6%9F%A5%E5%88%97%E5%90%8D%E7%A7%B0%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%3C%2FA%3E%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscussions%2FHow-to-check-if-list-of-columns-exist-and-report-those-that-are%2Fm-p%2F515287%23U515287%22%20class%3D%22lia-mention-container-editor-message%20lia-img-icon-forum-thread%20lia-fa-icon%20lia-fa-forum%20lia-fa-thread%20lia-fa%22%20target%3D%22_blank%22%3E%E5%A6%82%E4%BD%95%E6%A3%80%E6%9F%A5%E5%88%97%E5%88%97%E8%A1%A8%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%E5%B9%B6%E4%BD%BF%E7%94%A8%E5%BC%B9%E5%87%BA%E7%AA%97%E5%8F%A3%E6%8A%A5%E5%91%8A%E7%BC%BA%E5%B0%91%E7%9A%84%E5%88%97%EF%BC%9F%3C%2FA%3E%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscussions%2FDetermining-if-a-column-exists%2Fm-p%2F6268%23U6268%22%20class%3D%22lia-mention-container-editor-message%20lia-img-icon-forum-thread%20lia-fa-icon%20lia-fa-forum%20lia-fa-thread%20lia-fa%22%20target%3D%22_blank%22%3E%E7%A1%AE%E5%AE%9A%E5%88%97%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%3C%2FA%3E%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscussions%2FCreate-a-new-Row-column-only-if-it-does-not-exist%2Fm-p%2F309172%23U309172%22%20class%3D%22lia-mention-container-editor-message%20lia-img-icon-forum-thread%20lia-fa-icon%20lia-fa-forum%20lia-fa-thread%20lia-fa%22%20target%3D%22_blank%22%3E%E4%BB%85%E5%BD%93%E5%88%97%E4%B8%8D%E5%AD%98%E5%9C%A8%E6%97%B6%E6%89%8D%E5%88%9B%E5%BB%BA%E6%96%B0%E7%9A%84%20Row()%20%E5%88%97%3C%2FA%3E%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscussions%2FValidate-column-name-exists-before-graphing%2Fm-p%2F5088%23U5088%22%20class%3D%22lia-mention-container-editor-message%20lia-img-icon-forum-thread%20lia-fa-icon%20lia-fa-forum%20lia-fa-thread%20lia-fa%22%20target%3D%22_blank%22%3E%E5%9C%A8%E7%BB%98%E5%9B%BE%E4%B9%8B%E5%89%8D%E9%AA%8C%E8%AF%81%E5%88%97%E5%90%8D%E7%A7%B0%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-572468%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3E%E5%A4%A7%E8%A7%84%E6%A8%A1%E5%AE%9A%E5%88%B6%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-573152%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E6%A3%80%E6%9F%A5%E5%88%97%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-573152%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E6%9B%B4%E5%A4%9A%E8%A7%81%E8%A7%A3%EF%BC%9A%3C%2FP%3E%3CUL%3E%3CLI%3E%E5%87%89%E7%88%BD%E7%9A%84%EF%BC%81%3CBR%20%2F%3E%E4%B8%8D%E7%9F%A5%E9%81%93%2F%E6%B3%A8%E6%84%8F%E5%88%B0%E6%AF%94%E8%BE%83%E6%9C%89%E6%95%88%3CEM%3E%E6%B2%A1%E6%9C%89%3C%2FEM%3E%E8%BF%99%3CSTRONG%3E%E7%BB%86%E7%BB%B3%3C%2FSTRONG%3E%E7%9A%84%E9%80%89%E9%A1%B9%3CSTRONG%3E%E8%8E%B7%E5%8F%96%E5%88%97%E5%90%8D%3C%2FSTRONG%3E%3CBR%20%2F%3E%E4%B8%80%E6%A0%B7%E5%BC%BA%E5%A4%A7%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F2687%22%20target%3D%22_blank%22%3E%40tx%E5%B0%BC%E5%B0%94%E6%A3%AE%3C%2FA%3E%E7%9A%84%3CCODE%20class%3D%22%20language-jsl%22%3E%E5%B0%9D%E8%AF%95%EF%BC%88%E5%88%97%EF%BC%88dt%EF%BC%8C%E2%80%9C%E5%B9%B4%E9%BE%84%E2%80%9D%EF%BC%89%EF%BC%89%3CBR%20%2F%3E%3C%2FCODE%3E%3CSTRONG%3E%3CSPAN%3E%E5%B9%B4%E9%BE%84%20~%20%E5%B9%B4%E9%BE%84%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3E%3CSPAN%3E%E5%8F%AA%E9%9C%80%E4%BD%BF%E7%94%A8%3C%2FSPAN%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%E7%BB%86%E7%BB%B3%3C%2FFONT%3E%3CSPAN%3E%E4%BD%9C%E4%B8%BA%E8%8E%B7%E5%8F%96%E5%88%97%E5%90%8D%E7%A7%B0%E7%9A%84%E5%8F%82%E6%95%B0%EF%BC%8C%E5%A6%82%E6%9E%9C%E6%82%A8%E6%83%B3%E5%8C%BA%E5%88%86%3C%2FSPAN%3E%3CSPAN%3E%3CSTRONG%3E%E5%B9%B4%E9%BE%84%3C%2FSTRONG%3E%E5%92%8C%3CSTRONG%3E%E5%B9%B4%E9%BE%84%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%0Adt%20%3D%20Open(%22%24SAMPLE_DATA%2FBig%20Class.jmp%22)%3B%0A%0A%0AShow(dt%20%26lt%3B%26lt%3B%20Get%20Column%20Names(String))%3B%0AShow(%20Contains(%20dt%20%26lt%3B%26lt%3B%20Get%20Column%20Names(String)%2C%20As%20Name(%20%22Age%22)%20)%20)%3B%20%2F%2F%20-%26gt%3B%20nope%0A%0AShow(dt%20%26lt%3B%26lt%3B%20Get%20Column%20Names)%3B%0AShow(%20Contains(%20dt%20%26lt%3B%26lt%3B%20Get%20Column%20Names%2C%20As%20Name(%20%22Age%22)%20)%20)%3B%20%2F%2F%20found%20!%0AShow(r%3Dtry(column(dt%2C%22Age%22)%26lt%3B%3CGET%20name%3D%22%22%3E%3C%2FGET%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-573023%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E6%A3%80%E6%9F%A5%E5%88%97%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-573023%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E5%BE%88%E5%A5%BD%20%EF%BC%9A%EF%BC%89%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E4%B8%BA%E4%BA%86%E9%98%B2%E6%AD%A2%E4%B8%80%E8%88%AC%E7%94%A8%E6%88%B7%E5%BF%98%E8%AE%B0%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EAs%20Name%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%E5%9C%A8%E4%BB%96%E4%BB%AC%E7%9A%84%E4%BB%A3%E7%A0%81%E4%B8%AD%EF%BC%8C%E5%A6%82%E4%BD%95%E5%90%91%E6%95%B0%E6%8D%AE%E8%A1%A8%E5%AF%B9%E8%B1%A1%E6%B7%BB%E5%8A%A0%E4%B8%80%E4%B8%AA%E5%87%BD%E6%95%B0%E6%9D%A5%E8%AF%A2%E9%97%AE%E8%AF%A5%E5%88%97%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%EF%BC%9A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FJMP-Wish-List%2Fdata-table-lt-lt-column-exists-quot-name-quot%2Fidi-p%2F573018%23M3138%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.jmp.com%2Ft5%2FJMP-Wish-List%2Fdata-table-lt-lt-column-exists-quot-name-quot%2Fidi-p%2F573018%23M3138%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-573017%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E6%A3%80%E6%9F%A5%E5%88%97%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-573017%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E6%88%91%E7%9B%B8%E4%BF%A1%E4%BD%A0%E5%BA%94%E8%AF%A5%E4%BD%BF%E7%94%A8%3CCODE%20class%3D%22%20language-jsl%22%3E%E4%BD%9C%E4%B8%BA%E5%90%8D%E7%A7%B0()%3C%2FCODE%3E%E4%B8%BA%E6%AD%A4%E5%8A%9F%E8%83%BD%E3%80%82%E5%AE%83%E4%BD%BF%E8%BF%99%E4%BA%9B%E6%A3%80%E6%9F%A5%E5%8F%98%E5%BE%97%E5%AE%B9%E6%98%93%EF%BC%8C%E6%82%A8%E4%B8%8D%E5%BF%85%E6%8B%85%E5%BF%83%E9%97%B4%E8%B7%9D%2F%E5%A4%A7%E5%86%99%EF%BC%9A%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20to%20Here(1)%3B%0Adt%20%3D%20Open(%20%22%24SAMPLE_DATA%2FBig%20Class.jmp%22%20)%3B%0A%0Adt%3Aage%20%26lt%3B%26lt%3B%20set%20name(%22a%20g%20e%22)%3B%0A%0AShow(%20Contains(%20dt%20%26lt%3B%26lt%3B%20Get%20Column%20Names%2C%20As%20Name(%20%22a%20ge%22%20)%20)%20)%3B%0A%0AShow(%20Contains(%20dt%20%26lt%3B%26lt%3B%20Get%20Column%20Names%2C%20As%20Name(%20%22S%20%20%20eX%22%20)%20)%20)%3B%0A%0Aname%20to%20check%20%3D%20%22N%20a%20ME%22%3B%0AShow(%20Contains(%20dt%20%26lt%3B%26lt%3B%20Get%20Column%20Names%2C%20As%20Name(%20name%20to%20check%20)%20)%20)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-573006%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E6%A3%80%E6%9F%A5%E5%88%97%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-573006%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E4%BA%8B%E5%AE%9E%E4%B8%8A%EF%BC%8C%E6%B2%A1%E6%9C%89%3CSTRONG%3E%3CEM%3E%E9%9C%80%E8%A6%81%3C%2FEM%3E%3C%2FSTRONG%3E%E5%8E%BB%E9%97%AE%E5%90%8D%E5%AD%97%EF%BC%8C%E5%AF%B9%E5%90%97%EF%BC%9F%3CBR%20%2F%3E%E8%AF%80%E7%AA%8D%E5%9C%A8%E4%BA%8E%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ETry(column(dt%2C%22age%22)%2C%20%3CEM%3Echeck%20for%20failure%3C%2FEM%3E)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CBLOCKQUOTE%3E%3CHR%20%2F%3E%3C%2FBLOCKQUOTE%3E%3CP%3E%E5%B0%9D%E8%AF%95%E8%8E%B7%E5%8F%96%E8%AF%A5%E5%88%97%20-%20%E5%B9%B6%E6%A3%80%E6%9F%A5%E5%AE%83%E6%98%AF%E5%90%A6%E5%A4%B1%E8%B4%A5%E3%80%82%3C%2FP%3E%3CP%3E%E4%B8%8D%E4%BB%85%E6%98%AF%E8%B6%85%E7%9F%AD%20-%20%E8%80%8C%E4%B8%94%E8%BF%98%E6%98%AF%E4%B8%80%E4%B8%AA%E7%BB%9D%E4%BD%B3%E7%9A%84%E9%80%89%E6%8B%A9%3CSTRONG%3E%E9%B2%81%E6%A3%92%E6%80%A7%3C%2FSTRONG%3E%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%E5%B9%B6%E4%B8%94%20-%20%E4%BD%9C%E4%B8%BA%E9%94%A6%E4%B8%8A%E6%B7%BB%E8%8A%B1%20-%20%E5%90%91%E4%B8%93%E6%A0%8F%E8%AF%A2%E9%97%AE%E5%85%B6%E5%90%8D%E7%A7%B0%EF%BC%9A%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Er%3Dtry(column(dt%2Ctn)%26lt%3B%3CGET%20name%3D%22%22%3E%3C%2FGET%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%E4%B8%80%E4%B8%AA%E5%BE%88%E5%A5%BD%E7%9A%84%E6%8A%80%E5%B7%A7%EF%BC%8C%E5%8F%AF%E4%BB%A5%E4%B8%BA%E7%8E%B0%E6%9C%89%E5%92%8C%E4%B8%8D%E5%AD%98%E5%9C%A8%E7%9A%84%E5%88%97%E8%8E%B7%E5%8F%96%E6%98%8E%E7%A1%AE%E5%AE%9A%E4%B9%89%E7%9A%84%E8%BF%94%E5%9B%9E%E7%B1%BB%E5%9E%8B%E3%80%82%20%E8%B0%A2%E8%B0%A2%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F2687%22%20target%3D%22_blank%22%3E%40tx%E5%B0%BC%E5%B0%94%E6%A3%AE%3C%2FA%3E%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%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-572570%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E6%A3%80%E6%9F%A5%E5%88%97%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-572570%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E6%88%91%E5%8F%91%E7%8E%B0%E7%9A%84%E6%9C%80%E5%8F%AF%E9%9D%A0%E7%9A%84%E6%96%B9%E6%B3%95%E6%98%AF%E8%AF%A2%E9%97%AE%E5%8F%98%E9%87%8F%E7%9A%84%E5%90%8D%E7%A7%B0%EF%BC%8C%26lt%3B%26lt%3B%20get%20name%3C%2FP%3E%0A%3CP%3E%E5%AE%83%E5%B0%8A%E9%87%8D%E7%A9%BA%E7%99%BD%E7%AD%89%E3%80%82%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Enames%20default%20to%20here(1)%3B%0Adt%3Dcurrent%20data%20table()%3B%0Adt%3Aage%20%26lt%3B%26lt%3B%20set%20name(%22a%20g%20e%22)%3B%0Atn%3D%22age%22%3B%0Ar%3Dtry(column(dt%2Ctn)%26lt%3B%3CGET%20name%3D%22%22%3E%3C%2FGET%3E%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-572558%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E6%A3%80%E6%9F%A5%E5%88%97%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-572558%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E6%88%91%E7%9A%84%E6%9C%80%E7%88%B1%EF%BC%9A%E5%90%89%E5%A7%86%E7%9A%84%E6%83%B3%E6%B3%95%E5%8F%AA%E6%98%AF%3CSTRONG%3E%E9%97%AE%3C%2FSTRONG%3E%E8%AF%A5%E5%88%97%E7%9A%84%E6%95%B0%E6%8D%AE%E8%A1%A8%E5%B9%B6%E6%A3%80%E6%9F%A5%E6%95%B0%E6%8D%AE%E8%A1%A8%E6%98%AF%E5%90%A6%E6%9C%89%E9%97%AE%E9%A2%98%E3%80%82%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E4%BD%86%E5%8D%B3%E4%BD%BF%E8%BF%99%E7%A7%8D%E6%96%B9%E6%B3%95%E4%B9%9F%E4%BE%9D%E8%B5%96%E4%BA%8E%E8%BF%99%E6%A0%B7%E4%B8%80%E4%B8%AA%E4%BA%8B%E5%AE%9E%EF%BC%9A%E8%AF%A2%E9%97%AE%E6%97%B6%E5%88%97%E5%90%8D%E7%A7%B0%E7%9A%84%E6%8B%BC%E5%86%99%E4%B8%8E%E5%AE%9E%E9%99%85%E5%90%8D%E7%A7%B0%E7%9B%B8%E7%AC%A6%E3%80%82%3C%2FP%3E%3CP%3E%E4%BE%8B%E5%A6%82%EF%BC%8C%E5%A6%82%E6%9E%9C%E6%82%A8%E8%AF%A2%E9%97%AE%E2%80%9Cage%E2%80%9D%EF%BC%8C%E5%AE%83%E4%B8%8D%E4%BC%9A%E6%89%BE%E5%88%B0%E2%80%9Cage%20e%E2%80%9D%E3%80%82%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E4%BD%86%E6%96%B0%E4%B8%93%E6%A0%8F%3CSTRONG%3E%EF%BC%9A%E5%B9%B4%E9%BE%84%3C%2FSTRONG%3E%E4%BC%9A%E5%88%87%E6%96%AD%E4%B9%8B%E9%97%B4%E7%9A%84%E6%89%80%E6%9C%89%E9%93%BE%E6%8E%A5%3CSTRONG%3E%EF%BC%9A%E5%B9%B4%E9%BE%84%3C%2FSTRONG%3E%E5%92%8C%E7%8E%B0%E6%9C%89%E7%9A%84%E4%B8%93%E6%A0%8F%3CSTRONG%3E%EF%BC%9A%E5%B9%B4%E9%BE%84%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%E8%BF%99%E5%8F%AF%E8%83%BD%E4%BC%9A%E5%AF%BC%E8%87%B4%E6%AD%A4%E7%B1%BB%E9%99%84%E5%B8%A6%E6%8D%9F%E5%AE%B3%EF%BC%9A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20to%20Here(1)%3B%0Adt%20%3D%20Open(%20%22%24SAMPLE_DATA%2FBig%20Class.jmp%22%20)%3B%0A%0Adt%3Aage%20%26lt%3B%26lt%3B%20set%20name(%22a%20g%20e%22)%3B%0A%0AShow(dt%3A%20age%20%5B5%5D)%3B%20%2F%2F%20points%20to%20the%20existing%20column%0A%20%0ATry(%3Ais%20there%20a%20%3D%20column(dt%2C%22age%22)%2C%20%22answer%3A%20no%22)%3B%0A%0Anew%20Column(%22age%22)%3B%0AShow(dt%3A%20age%5B5%5D)%26nbsp%3B%2F%2F%26nbsp%3Bpoints%26nbsp%3Bto%26nbsp%3Bthe%26nbsp%3Bnew%26nbsp%3Bcolumn%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-572549%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E6%A3%80%E6%9F%A5%E5%88%97%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-572549%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E4%BC%BC%E4%B9%8E%E8%BF%99%E4%BA%9B%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%E4%B8%AD%E7%9A%84%E6%AF%8F%E4%B8%80%E4%B8%AA%E9%83%BD%E6%9C%89%E6%95%88%E3%80%82%20%E6%9C%80%E5%BC%BA%E5%A4%A7%E7%9A%84%E5%8F%AF%E8%83%BD%E6%98%AF%E7%AC%AC%E4%BA%8C%E4%B8%AA%E9%93%BE%E6%8E%A5%EF%BC%8C%E4%BD%86%E5%AE%83%E4%B9%9F%E6%9C%89%E6%9C%80%E5%A4%9A%E7%9A%84%E4%BB%A3%E7%A0%81%E8%A1%8C%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
hogi
Level XI

check if column exists?

Hi,

I want to create a new column and before doing so:

ask the data table if the column already exists.

 

Is there a "best" way such that the code can be shared with other colleagues in the company?

 

Check column name if existing 

How to check if list of columns exist and report those that are missing using a pop-up window? 

Determining if a column exists 

 

Validate column name exists before graphing 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: check if column exists?

The most reliable method that I have found, is to ask for the name of the variable, << get name

It honors blanks, etc.

names default to here(1);
dt=current data table();
dt:age << set name("a g e");
tn="age";
r=try(column(dt,tn)<<get name,"");
Jim

View solution in original post

7 REPLIES 7

Re: check if column exists?

Seems like each of those solutions would work. The most robust would likely be the 2nd link, but it also has the most lines of code.

hogi
Level XI

Re: check if column exists?

my farorite: Jim's idea to just ask the data table for the column and check if the data table complains.

 

But even this approach relies on the fact that the spelling of the column name while asking fits to the actual name.

e.g. it doesn't find "a g e" if you ask for "age".

 

But the new column :age would cut all links between :age and the existing column :a g e

This could lead to such collateral damages:

 

Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dt:age << set name("a g e");

Show(dt: age [5]); // points to the existing column
	
Try(:is there a = column(dt,"age"), "answer: no");

new Column("age");
Show(dt: age[5]) // points to the new column
txnelson
Super User

Re: check if column exists?

The most reliable method that I have found, is to ask for the name of the variable, << get name

It honors blanks, etc.

names default to here(1);
dt=current data table();
dt:age << set name("a g e");
tn="age";
r=try(column(dt,tn)<<get name,"");
Jim
hogi
Level XI

Re: check if column exists?

Actually, no need to ask for the name, right?
The trick lies in the 

Try(column(dt,"age"), check for failure);

Try to get the column - and check if it fails.

Not only ultra-short - but also an excellent choice regarding robustness  

 

And - as the icing on the cake - ask the column for it's name:

r=try(column(dt,tn)<<get name,"");

A nice trick to get a well-defined return type for existing and non-existing columns. Thanks @txnelson 

ErraticAttack
Level VI

Re: check if column exists?

I believe that you're just supposed to use the As Name() function for this.  It makes these checks easy and you don't have to worry about spacing / capitalizations:

Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dt:age << set name("a g e");

Show( Contains( dt << Get Column Names, As Name( "a ge" ) ) );

Show( Contains( dt << Get Column Names, As Name( "S   eX" ) ) );

name to check = "N a ME";
Show( Contains( dt << Get Column Names, As Name( name to check ) ) )
Jordan
hogi
Level XI

Re: check if column exists?

Ah nice

 

To prevent users in general from forgetting the

As Name

in their code, how about adding a function to the data table object to ask if the column exists:

https://community.jmp.com/t5/JMP-Wish-List/data-table-lt-lt-column-exists-quot-name-quot/idi-p/57301... 

 

 

hogi
Level XI

Re: check if column exists?

some more insights:

  • cool!
    Didn't know/notice that the comparison works without the string option of get column names 
    as robust as @txnelson's   try(column(dt,"Age"))
    age ~ Age

 

  • just use string as an argument for Get Column Names if you want to differentiate between age  and  Age

 

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");


Show(dt << Get Column Names(String));
Show( Contains( dt << Get Column Names(String), As Name( "Age") ) ); // -> nope

Show(dt << Get Column Names);
Show( Contains( dt << Get Column Names, As Name( "Age") ) ); // found !
Show(r=try(column(dt,"Age")<<get name,"")); // found :)

Show(dt:Age[1]);
dt << New Column("Age", Numeric, Ordinal);
dt:Age[1] = 0;
Show(dt:Age[1]);


wait(1);