Filemaker text function PatternCount

Posted on 2011-05-11
Last Modified: 2012-05-11
Can PatternCount(text;searchString) be invoked on a carriage return separated list of numbers, or does the text have to be a string? If the latter, will it work to use GetAsString to convert a list of numbers to a string? I want to search a field populated with a list of numbers for any occurrence of the numeral 3.
Question by:MarkJulie
    LVL 24

    Expert Comment

    by:Will Loving
    PatternCount() will search the entire field regardless of the number of carriage returns. There is also a similar function called ValueCount() which can search a return separated list of values for a matching value. For example, if you have the list:


    For PatternCount( myList ; "3" ) you would get 2 as the answer.
    For ValueCount( myList ; "3" ) you would get 0 as the answer.
    For ValueCount( myList ; "893" ) you would get 1 as the answer.

    Further, the Custom Function PositionValue will give the position in return separated list of a particular value.

    PositionValue ( myList; "893"; 1; 1 ) = 3


    Author Comment

    Does ValueCount require a string of the same length to match (i.e., no substrings)?
    Would PatternCount( myList ; "89" ) return 1?
    I also assume using GetAsText(myList) is unnecessary?
    Thanks for the Brian Dunning link.
    LVL 24

    Accepted Solution

    ValueCount looks at the entire string in each value, i.e. each carriage return separated value, so it has to match the entire 'value' up to the carriage return.

    Yes, PatternCount( myList ; "89" ) would return 1. PatternCount( myList ; "2" ) would return 4.

    I'm not 100% positive about the GetAsText() being unnecessary but I'm pretty sure ValueCount() treats even a number fields as text for this purpose because it is a "text" function. Easiest way to find out would be to test. The one important test would be to check for leading zeroes since a number field generally ignores them but a text field does not.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
    Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
    This video discusses moving either the default database or any database to a new volume.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now