January 2, 201412 yr Hi there I have a filtered portal that uses pattern count to filter.... It works fine but I would quite like the pattern count to behave a bit differently.... Instead of it looking at the whole word I would like it to act on just the start... eg... If a user types "Neff" then Neff should appear but NOT Benne or Hene!
January 2, 201412 yr If a user types "Neff" then Neff should appear but NOT Benne or Hene! Those wouldn't appear anyway, because PatternCount checks for the presence of the entire string, and not any sub-string permutations. Do you mean you want to see “Neff”, but not, say, "Mister Neff” or “aNeff”? Then try: Let ( f = myTable::myPortalFilter ; f = Left ( portalTO::field ; Length ( f ) ) ) If you want to apply PatternCount to the first word, try: PatternCount ( LeftWords ( portalTO::field ; 1 ) ; myTable::myPortalFilter )
January 2, 201412 yr Author Those wouldn't appear anyway, because PatternCount checks for the presence of the entire string, and not any sub-string permutations. Do you mean you want to see “Neff”, but not, say, "Mister Neff” or “aNeff”? Then try: Let ( f = myTable::myPortalFilter ; f = Left ( portalTO::field ; Length ( f ) ) ) If you want to apply PatternCount to the first word, try: PatternCount ( LeftWords ( portalTO::field ; 1 ) ; myTable::myPortalFilter ) Basically I want ... Patterncount( "Neff";"Ne") to return 1 BUT Patterncount( "Neff";"ff") to return 0... because I want the pattercount to only work starting from the beginning of the string.
January 2, 201412 yr Basically I want ... Patterncount( "Neff";"Ne") to return 1 BUT Patterncount( "Neff";"ff") to return 0... because I want the pattercount to only work starting from the beginning of the string. Well, then you're not actually searching for a pattern, but comparing two strings; use the first method.
Create an account or sign in to comment