liltbrockie Posted January 2, 2014 Posted January 2, 2014 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!
eos Posted January 2, 2014 Posted January 2, 2014 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 )
liltbrockie Posted January 2, 2014 Author Posted January 2, 2014 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.
eos Posted January 2, 2014 Posted January 2, 2014 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.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now