3 Replies Latest reply on Dec 28, 2013 10:23 PM by keywords

    Field to total up a field in all records

    hafiz5198

      I've created a field to calculate the contents of about 12 fields. The problem is how to create another field so that it will calculate the total of the 12 same fields in all records?

        • 1. Re: Field to total up a field in all records
          keywords

          To do this you will need to create a cartesian relationship and run your calc through that so that the calc has access to all records.

          1 of 1 people found this helpful
          • 2. Re: Field to total up a field in all records
            hafiz5198

            ...and how can I do that? Please explain a little bit on the 'cartesian relationship'

            • 3. Re: Field to total up a field in all records
              keywords

              A cartesian join uses the X operator when you set up the relationship. This type of join ignores the field contents of the match fields and simply matches all records in one table with all records in the other. If you use this in a self join relationship, you get a whole of table match. You can then achieve a total of all records in the table by pointing your calculation through that relationship.

               

              If you use a calc like fieldA + fieldB you will get only the total of those two fields on the current record added together.

               

              However if you use Sum ( wholeFile::fieldA ) + Sum ( wholeFile::fieldB ) you will get the total of those two fields in all records, which I think is what you are after.