# Creating a monthly table of grouped data

Hello Bubblers,
I’m seeking a little help. I’ve tried to read as much as I can in the forum however I have been hitting a brick wall over and over and I am on the verge of pulling my hair out!

I am trying to create a personal money tracker app that has a “Monthly Table” that shows the previous month and the next six months.
In this table I would like to have the first row showing the sum of Cash IN for each month, the 2nd row to show sum of Cash OUT for each month and the third row, The BALANCE for the respective month. (IN minus OUT)

Important Notes
Each Cash IN field should also include the BALANCE of the previous month.

Questions (I’ll limit the number of queries I have to hopefully focus on one major issue at a time)

1. Should I have a single Transactions data type or should I separate Cash IN Transactions from Cash OUT Transactions into their own data type?

1a. If the transactions are in one data type:
I’d need to use a “Transaction Class” field for example to indicate the ones that are IN vs. OUT. In the monthly table described above, how do I then show ONLY transactions that are IN in one cell vs. OUT transactions in its own cell in the same Repeating Group?

Problem Faced thus far: When I add a 2nd group to hopefully filter out (i.e. Transaction Class = OUT), I am seeing two columns for each month (One for each “Transaction Class.”)*

1b. If the transactions are in separate Data type tables:
What would I set as the data source for the RG “Monthly Table”?

What I have tried: *I tried doing a grouped RG for IN & another for OUT. *
The Problem I face is, When I try to pull results from both into a third RG to perform the IN minus OUT calculation, this 3rd RG is pulling the full totals of the respective table and showing the same value in all months. (i.e. sum of all INs for the year minus the sum for all OUTs for the year instead of for the respective month)

1. How would I then minus the result from the OUT from the result of the IN for the respective month?
2. How would I then add the BALANCE of the previous month to the current IN?