# calculating unique letters in string - FileMaker

Question: Is it possible to calculate the unique letters in a string? for example boat got 4 unique letters, but feather got 6 unique letters from a total of 7 (2 times the 'e') .. is there a way to do that? Thanx, Patrick...

1. ## calculating unique letters in string

Question: Is it possible to calculate the unique letters in a string?
for example boat got 4 unique letters, but feather got 6 unique
letters from a total of 7 (2 times the 'e') .. is there a way to do
that?

Thanx,

Patrick
Patrick Guest

2. ## Re: calculating unique letters in string

Yes, probably several ways. Easiest (and possibly most awkward) would be to

UniqueLetters (calculation, number) = (PatternCount (YourField, "a") > 0) +
(PatternCount (YourField, "b") > 0) + (PatternCount (YourField, "c") > 0) +
....(PatternCount (YourField, "z") > 0)

Another way would be to utilize repeating fields:

Alphabet (global, text, 26 repetitions) - fill each repetition with a
letter from "a" to "z"

LettersUsed (calculation, number, 26 repetitions) = PatternCount (Extend
(YourField), Alphabet) > 0

UniqueLetters (calculation, number) = Sum (LettersUsed)

news:a76rgvod04l1bvos17011bpnvkqhfpkv404ax.com...
> Question: Is it possible to calculate the unique letters in a string?
> for example boat got 4 unique letters, but feather got 6 unique
> letters from a total of 7 (2 times the 'e') .. is there a way to do
> that?
>
> Thanx,
>
> Patrick

Glenn Schwandt Guest

3. ## Re: calculating unique letters in string

Ok, gonna give them a try.. .thanx....

On Thu, 10 Jul 2003 12:20:43 -0500, "Glenn Schwandt"
<schwandtgataoldot.com> wrote:
>Yes, probably several ways. Easiest (and possibly most awkward) would be to
>
>UniqueLetters (calculation, number) = (PatternCount (YourField, "a") > 0) +
>(PatternCount (YourField, "b") > 0) + (PatternCount (YourField, "c") > 0) +
>...(PatternCount (YourField, "z") > 0)
>
>Another way would be to utilize repeating fields:
>
>Alphabet (global, text, 26 repetitions) - fill each repetition with a
>letter from "a" to "z"
>
>LettersUsed (calculation, number, 26 repetitions) = PatternCount (Extend
>(YourField), Alphabet) > 0
>
>UniqueLetters (calculation, number) = Sum (LettersUsed)
>
>news:a76rgvod04l1bvos17011bpnvkqhfpkv404ax.com.. .
>> Question: Is it possible to calculate the unique letters in a string?
>> for example boat got 4 unique letters, but feather got 6 unique
>> letters from a total of 7 (2 times the 'e') .. is there a way to do
>> that?
>>
>> Thanx,
>>
>> Patrick
>
Patrick Guest

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•