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-8292%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EFilter%20a%20string%20using%20%22like%22%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-8292%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EUsing%20the%20example%20below%2C%20how%20could%20I%20filter%20all%20the%20names%20starting%20like%20%22M%22%3C%2FP%3E%3CP%3EIs%20it%20possible%20to%20use%20%22like%22%20or%20something%20similar%20%3F%3C%2FP%3E%3CP%3EData%20Filter(%20Add%20Filter(%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20columns(%20%3Aname%20)%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Where(%20%3Aname%20like%20M*%20)%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F%2F%2F%20Not%20working%20of%20course%20!%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20)%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EThanks%20for%20you%20help%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3Eopen(%22%24sample_data%5CBig%20class.jmp%22)%3B%3C%2FP%3E%3CP%3EGraph%20Builder(%3C%2FP%3E%3CP%3ESize(%20454%2C%20472%20)%2C%3C%2FP%3E%3CP%3EShow%20Control%20Panel(%200%20)%2C%3C%2FP%3E%3CP%3EVariables(%20X(%20%3Aage%20)%2C%20Y(%20%3Aweight%20)%2C%20Y(%20%3Aheight%20)%2C%20Overlay(%20%3Aname%20)%20)%2C%3C%2FP%3E%3CP%3EElements(%20Position(%201%2C%201%20)%2C%20Points(%20X%2C%20Y%2C%20Legend(%203%20)%2C%20Jitter(%201%20)%20)%20)%2C%3C%2FP%3E%3CP%3EElements(%20Position(%201%2C%202%20)%2C%20Points(%20X%2C%20Y%2C%20Legend(%204%20)%2C%20Jitter(%201%20)%20)%20)%3C%2FP%3E%3CP%3E)%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-8296%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20Filter%20a%20string%20using%20%22like%22%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-8296%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EThanks%20for%20your%20help%20%3CSPAN%20__jive_emoticon_name%3D%22happy%22%20__jive_macro_name%3D%22emoticon%22%20class%3D%22jive_macro%20jive_macro_emoticon%20jive_emote%22%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2F5.0.2%2Fimages%2Femoticons%2Fhappy.gif%22%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EGeof%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-8295%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20Filter%20a%20string%20using%20%22like%22%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-8295%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EUnfortunately%2C%20the%20Data%20Filter%20in%20JMP%20doesn't%20support%20partial%20string%20matches.%20You%20must%20match%20whole%20values.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EHowever%2C%20you%20can%20find%20all%20the%20values%20that%20match%20your%20partial%20string%20and%20then%20use%20that%20list%20in%20your%20call%20to%20the%20data%20filter.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%20color%3A%20%23942193%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3Edt%20%3D%20open%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%3C%2FSPAN%3E%22%24sample_data%5CBig%20class.jmp%22%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E)%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3EGraph%20Builder%3CSTRONG%3E(%3C%2FSTRONG%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3ESize%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E454%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E472%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3EShow%20Control%20Panel%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E0%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3EVariables%3CSTRONG%3E(%3C%2FSTRONG%3E%20X%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3A%3C%2FSPAN%3Eage%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Y%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3A%3C%2FSPAN%3Eweight%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Y%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3A%3C%2FSPAN%3Eheight%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Overlay%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3A%3C%2FSPAN%3Ename%20%3CSTRONG%3E)%3C%2FSTRONG%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3EElements%3CSTRONG%3E(%3C%2FSTRONG%3E%20Position%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E1%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E1%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Points%3CSTRONG%3E(%3C%2FSTRONG%3E%20X%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Y%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Legend%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E3%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Jitter%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E1%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3EElements%3CSTRONG%3E(%3C%2FSTRONG%3E%20Position%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E1%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E2%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Points%3CSTRONG%3E(%3C%2FSTRONG%3E%20X%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Y%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Legend%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E4%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Jitter%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E1%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3E%2F%2Fcreate%20a%20list%20of%20the%20unique%20names%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3Esummarize%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3Enameslist%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3D%3C%2FSPAN%3Eby%3CSTRONG%3E(%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3A%3C%2FSPAN%3Ename%3CSTRONG%3E))%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2F%2Fcreate%20a%20matrix%20to%20hold%20the%20locations%20of%20the%20strings%20that%20match%20your%20pattern%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3Ex%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3D%3C%2FSPAN%3E%3CSTRONG%3E%5B%5D%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%2F%2Floop%20over%20list%20of%20names%20storing%20the%20matches%20in%20x%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3EFor%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%20i%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E1%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20i%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%26lt%3B%3D%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3EN%20Items%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%20nameslist%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20i%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2B%2B%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3EIf%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3EStarts%20With%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%20nameslist%3CSTRONG%3E%5B%3C%2FSTRONG%3Ei%3CSTRONG%3E%5D%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23942193%3B%22%3E%22M%22%3C%2FSPAN%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2F%2F%20%22%7C%2F%22%20is%20the%20matrix%20vertical%20concat%20operator%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%26nbsp%3B%20x%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3D%3C%2FSPAN%3E%20x%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%7C%2F%3C%2FSPAN%3E%20i%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%26nbsp%3B%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3Edt%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%26lt%3B%26lt%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3CSTRONG%3EData%20Filter%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%26nbsp%3B%20Location%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSTRONG%3E%7B%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E848%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E24%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSTRONG%3E%7D%3C%2FSTRONG%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%26nbsp%3B%20Add%20Filter%3CSTRONG%3E(%3C%2FSTRONG%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%26nbsp%3B%20columns%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3A%3C%2FSPAN%3Ename%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%26nbsp%3B%20Where%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3A%3C%2FSPAN%3Ename%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3D%3D%3C%2FSPAN%3E%20nameslist%3CSTRONG%3E%5B%3C%2FSTRONG%3Ex%3CSTRONG%3E%5D%3C%2FSTRONG%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%26nbsp%3B%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-8294%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20Filter%20a%20string%20using%20%22like%22%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-8294%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EYour%20options%20to%20mimic%20a%20like%20statement%20are%20as%20follows%3A%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EWhere(%20starts%20with%20(%3Aname%2C%20%22M%22%20))%20%2F*%20Name%20starting%20with%20M%20*%2F%3C%2FP%3E%3CP%3EWhere(%20ends%20with%20(%3Aname%2C%20%22M%22%20))%26nbsp%3B%20%2F*%20Name%20ending%20with%20M%20*%2F%3C%2FP%3E%3CP%3EWhere(%20contains%20(%3Aname%2C%20%22M%22%20))%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F*%20Name%20contains%20M%20*%2F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-8293%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20Filter%20a%20string%20using%20%22like%22%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-8293%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EI%20think%20the%20filter%20function%20you%20are%20looking%20for%20is%3A%3C%2FP%3E%3CP%3Estarts%20with(%20name%2C%20%22M%22%20)%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EMK%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
geof
Level III

Filter a string using "like" ?

Hello,

Using the example below, how could I filter all the names starting like "M"

Is it possible to use "like" or something similar ?

Data Filter( Add Filter(

        columns( :name ),

        Where( :name like M* )       /// Not working of course !

       ),

Thanks for you help

open("$sample_data\Big class.jmp");

Graph Builder(

Size( 454, 472 ),

Show Control Panel( 0 ),

Variables( X( :age ), Y( :weight ), Y( :height ), Overlay( :name ) ),

Elements( Position( 1, 1 ), Points( X, Y, Legend( 3 ), Jitter( 1 ) ) ),

Elements( Position( 1, 2 ), Points( X, Y, Legend( 4 ), Jitter( 1 ) ) )

);

1 ACCEPTED SOLUTION

Accepted Solutions
Jeff_Perkinson
Community Manager Community Manager

Re: Filter a string using "like" ?

Unfortunately, the Data Filter in JMP doesn't support partial string matches. You must match whole values.

However, you can find all the values that match your partial string and then use that list in your call to the data filter.

dt = open("$sample_data\Big class.jmp");

Graph Builder(

Size( 454, 472 ),

Show Control Panel( 0 ),

Variables( X( :age ), Y( :weight ), Y( :height ), Overlay( :name ) ),

Elements( Position( 1, 1 ), Points( X, Y, Legend( 3 ), Jitter( 1 ) ) ),

Elements( Position( 1, 2 ), Points( X, Y, Legend( 4 ), Jitter( 1 ) ) )

);


//create a list of the unique names

summarize(nameslist=by(:name));


//create a matrix to hold the locations of the strings that match your pattern

x=[];

//loop over list of names storing the matches in x

For( i = 1, i <= N Items( nameslist ), i++,

  If( Starts With( nameslist[i], "M" ),

// "|/" is the matrix vertical concat operator

  x = x |/ i;

  )

);

dt << Data Filter(

  Location( {848, 24} ),

  Add Filter(

  columns( :name ),

  Where( :name == nameslist[x] ),

  )

);



-Jeff

View solution in original post

4 REPLIES 4
mikekutz
Level I

Re: Filter a string using "like" ?

I think the filter function you are looking for is:

starts with( name, "M" )

MK

sasguy
Level I

Re: Filter a string using "like" ?

Your options to mimic a like statement are as follows:

Where( starts with (:name, "M" )) /* Name starting with M */

Where( ends with (:name, "M" ))  /* Name ending with M */

Where( contains (:name, "M" ))    /* Name contains M */

Jeff_Perkinson
Community Manager Community Manager

Re: Filter a string using "like" ?

Unfortunately, the Data Filter in JMP doesn't support partial string matches. You must match whole values.

However, you can find all the values that match your partial string and then use that list in your call to the data filter.

dt = open("$sample_data\Big class.jmp");

Graph Builder(

Size( 454, 472 ),

Show Control Panel( 0 ),

Variables( X( :age ), Y( :weight ), Y( :height ), Overlay( :name ) ),

Elements( Position( 1, 1 ), Points( X, Y, Legend( 3 ), Jitter( 1 ) ) ),

Elements( Position( 1, 2 ), Points( X, Y, Legend( 4 ), Jitter( 1 ) ) )

);


//create a list of the unique names

summarize(nameslist=by(:name));


//create a matrix to hold the locations of the strings that match your pattern

x=[];

//loop over list of names storing the matches in x

For( i = 1, i <= N Items( nameslist ), i++,

  If( Starts With( nameslist[i], "M" ),

// "|/" is the matrix vertical concat operator

  x = x |/ i;

  )

);

dt << Data Filter(

  Location( {848, 24} ),

  Add Filter(

  columns( :name ),

  Where( :name == nameslist[x] ),

  )

);



-Jeff
geof
Level III

Re: Filter a string using "like" ?

Thanks for your help

Geof

Recommended Articles