Adding totals and saving to database

Hi, I am new to Bubble I am trying to create a finance app for my internal consumption.

I wanted help with the following (I am not able to understanding this, after reading various posts).

I have two broad drop downs (for receipts and payments). Under this, there are other drop downs (for eg under receipts, there is dividend, interest, etc and under payments, there is other expenses, etc). For eg, once the user selects receipts, and then selects Dividend, he can enter the amount of dividend and save the data.

I want to be able to have a drop down on the side, wherein, if the user selects dividend, it totals up all the dividend amounts entered till date, and shows this value. If he selects interest, the total of all the interest amount should be showed.

I am unable to figure how to add, and display this data.