1 Reply Latest reply on Jan 23, 2014 8:24 AM by philmodjunk

    Get the number of unique entries on a value list

    Badam

      Title

      Get the number of unique entries on a value list

      Post

           Using script step(s) I am looking for how many unique values are contained within a value: list, (there are duplicates within the list) I have the list defined as:

      Set Variable [$VendorList ; Value: List ( BOM::Vendor ID ) ]

      I would like to add a script line that defines another variable ($NumOfVendors) representing total unique values in the $VendorList

      if the list were:

      VID001

      VID002

      VID001

      VID003

      then the variable would be set at $NumOfVendors = 3

        • 1. Re: Get the number of unique entries on a value list
          philmodjunk

               With FileMaker 12 and 13, ExecuteSQL with the DISTINCT key word can provide you with this count.

               With the list function, (as will be needed with older versions or those that don't choose to try SQL), if you have this set of relationships:

               Product---<BOM>----Vendors

               You can use:

               ValueCount ( Vendors::Vendor ID )

               and you'll get a count of each vendor without any duplicates.