### Title

Sum(PortalTableOccurence::FieldName) HELP!

### Post

Good morning everyone! I have a portal that has a field (Amount) that I wanted to sum up all its values, but the formula I'm using won't add correctly it was just showing the first number of the values in the portal. The field which I called DailyCost contains the formula for getting the sum of the the field (Amount) in the portal.

The formula that I used is:

Sum(COSTTABLE::Amount)

The DailyCost will be added to another field which I called Previous and it will be in a field called TotalCost where I used the calculation: COSTTABLE::Amount + COSTTABLE::Previous.

And also, when I do the next day, the TotalCost value from the previous day will be the value of my Previous field.

I tried using the GetNthRecord(COSTTABLE::TotalCost;Get(RecordNumber) - 1) but didn't work, is there something I forgot here or something that I need to change?

Any idea, help is deeply appreciated.

Then it should compute the total for all the related records--which will be all the items in your portal unless you filter the portal.

Did you use a field of type calculation or is this a number field with an auto-entered calculation?

It must be a field of type calculation, not auto-entered into a number field or it won't update when values in the related table are added/removed/changed.