# math formula

i just newly using glide and try to make ledger app. very basic app.
how to make all row auto calculate base on math formula. below my screen shoot.
debit-credit=bal. then last result in balance will do operation minus or plus in next row. that how it goes until end of row.

1 Like

Hola @Izhar,

If I understand correctly, you want to add/subtract the result of both columns, right?

If so, the way I would do it is to use a rollup column for the debit and a rollup column for the credit. Then thatâ€™s what Iâ€™d have in the math column.

1 Like

Hi Santiago,

Thank you for your opinion. I believe that what i want to do. to be more specific if user insert in debit or credit the result will be in balance. I used to do at spreadsheet using formula but it was manual. below is formula in spreadsheet.

1 Like

Iâ€™ve tried to implement a math formula which adds the current value plus the previous total through a relation, but there seems to be a bug and the math column doesnâ€™t add the previous value

yeah that was my problem too but it worked on spreadsheet.
i am still doing manual at spreadsheet for balance column so it
kind of half automation.

Hi Izhar,

I faced the same the problem before.

Iâ€™ve solved it with a little help of @gvalero

Iâ€™ve made a relation with the previous item and then I add the current value with the previous total. @gvalero solved the issue with the sum in the total colum multipliying the lookup column *1

3 Likes

if you can elaborate a little bit? meaning i have to create new spreadsheet and do lookup or vlookup?

No, you can do it inside Glide using a relation - lookup - math column.

There are no calcs in google sheet. All columns are in Glide.

1. A relation (â€śrel anteriorâ€ť) associates each item with previous item
2. A lookup column (â€śsum antâ€ť), inside Glide, gets the value of the previous total sum (â€śsumâ€ť) using that relation
3. A math formula , inside Glide, adds current item value with lookup column value in â€śsumâ€ť column. You can see the detail of this formula in the third picture.
1 Like

Hi Izhar,

Did you solved this issue?
If yes, share boleh tak?

Biha,
kau bantai ckp melayu ye
belum lagi. you can try first and share result with us.

1 Like

This way possible tak?

Add column math tu yang â€śDebit - Creditâ€ť
And Roll up of â€śDebit - Creditâ€ť with sum
But it showing the last balance.