I have a tableView and that tableview is being populated with data from Coredata. The data breaks down like this.

Entity - Person

Entity - Statement
The statement entity has an attribute called amountOwed and it is of decimal type.

The relationships is that a person can have many statements, but each statement belongs to a single person. 

Here is the path of the data that I would like to add up. Person > Statement > AmountOwed.

In the tableView function I have a let that represents the Person entity.

```
let person = fetchedResultsController.object(at: indexPath)

```

I know its working because I can print out the persons name like so 

```
print(person.name) // Bob

```

What I want to be able to do is add up all the amountOwed attributes for each Person inside the Statement entity and display them on a cell.

I have been trying to follow an example of calculated fetches but I seem to not quiet understand how to target my Statements Entities which are linked to each Person entity.

```
 let fetchRequest = NSFetchRequest<NSDictionary>(entityName:"statement")
            fetchRequest.resultType = .dictionaryResultType

            let sumExpressionDesc = NSExpressionDescription()
            sumExpressionDesc.name = "sumDeals"

            let specialCountExp = NSExpression(forKeyPath: #keyPath(Person.statement[indexPath].amountOwed))

            sumExpressionDesc.expression = NSExpression(forFunction: "sum:", arguments: [specialCountExp])

            sumExpressionDesc.expressionResultsType = .interger32AttributeType

            fetchRequest.propertiesToFetch = [sumExpressionDesc]

            do{
                let results = try coreDataStack.managedContext.fetch(fetchRequest)

                let resultDict = results.first!
                let numDeals = resultDict["sumDeals"]
                print(numDeals!)
            }

            catch let error as NSError{
                print("Count not fetched \(error), \(error.userInfo)")
            }

```

Do I need to fetch a Statement entity or should I just use the FetchedREsultsController? If I do use my fetchedResultsController does the keypath to the Statement Entity look like this

```
person[indexPath].statement.amountOwed

```