Hi all.

I have a problem with subtotal field.

I have 3 Fields, total pago, total recebido and saldo for N accounts.

Total Pago is a calcutation Sum(saldo_dia_conta_mov_diaria::valor_pago_calculado) field located in a Subsummary

Total recebido is a calculation too Sum(saldo_dia_conta_mov_diaria cr::valor_recebido_calculado) both using a relatalionship.

Saldo only the diference between Pago - recebido, saldo_inicial_relacao + GetSummary (total_contas_recebidas_cr; conta_para_fluxo_de_caixa) - GetSummary ( total_contas_pagas; conta_para_fluxo_de_caixa)

Now I need ai Summary, total of the total pago, more total of the total recebido and total of the Saldo, but if I use example a field in Trailing Grand Summary the Total is always the Summary of total.

Exemplo:

Account 1 = Total Pago R$ 200,00 Total Recebido R$ 400 saldo = R$ 200,00 OK.

Account 2 = Total Pago R$ 100,00 Total Recebido R$ 400 saldo = R$ 300,00 OK.

Total = R$ 300,00 Total = R$ 800,00 Total = R$ 500,00 ( my objetive)

But this total Summary Always the total of records in database and dont respect the relationship.

I hope has been clear.

Tks

Your sums appear to be totaling fields which are already summary-calculation totals.

Sums in subSummary parts depend on both proper sorting, and on being actual Sums of numbers/amounts, not sums of calculated sums.

If you retotal your calculated sum fields, you will get amounts which are too large, possibly the sum of all records, possibly even more, depending on howand what the calculated field is summarizing. (We cannot see your relationship structure to know what's being sumarized in the calcs across the various relationships.)