AnsweredAssumed Answered

A new way to count unique values in FileMaker 12

Question asked by philmodjunk on May 29, 2012
Latest reply on Oct 22, 2014 by Doug Staubach

Title

A new way to count unique values in FileMaker 12

Post

Say you have these values in a table:

Apple
Orange
Strawberry
Orange
Apple
Orange
Strawberry

and you don't want a count of all the records (7). You want a count of how many unique values exist (3). In previous versions of Filemaker, we've had to use the How to count the number of unique occurences in field. to produce this count. Or you might define a value list with the specify values from field option and use ValueCount ( ValueLIstItems ....) ) to count the unique values.

FileMaker 12 provides a new and much simpler method: ExecuteSQL

Here's the expression you can use for this:

ExecuteSQL ("SELECT COUNT ( DISTINCT YourFieldNameGoesHere ) FROM YourTableOccurrenceNameHere" ; "" ; ""  )

Outcomes