Help on generating a particular report for summarizing expenses for months

Thought that the process would be easy, but when I dug into the essentials of it, the process was not easy anymore.

There is an employee expense table, that records all expenses made by staff. The employee column is a ref to the main employee table. Other concerned cols are Date and Amount.

What I want to do is summarize the thing in a report for a particular Financial year, like this:

As of now, because I thought it might help, I have built a months table to correctly store the relationships of the months because it can be too overwhelming to use VCs for all that

3X_9_7_97318addaa0c04b8b1f06b67bcde355ef04aa014.png

But I have really ran into a never ending run while trying to build the report. Since I donโ€™t want to limit the choice of months, and the number of employees can increase / decrease indefinitely, there really are two variables here.

Maybe two start expressions? Or something else?

Solved Solved
0 2 159
1 ACCEPTED SOLUTION

Well again, I figured it out after posting

What I was trying to achieve, is in a nutshell, a case of many-many relationship. While one to one, or one to many relationships can suitably be defined within one and two tables (the constituent ones), defining many to many relationships requires a third table that holds the relation definition.

  1. I created an additional month-employee table, which holds all months as many times as the number of employees, as a child of the previously mentioned โ€˜monthsโ€™ table.

  2. Within that table I used the proper select functions to generate all the financial parameters like credits and expenses.

  3. Now within the report (from the months table), I used two start expressions. One to print out all the months from a chosen financial year, defined by a slice, and within that to print out all the Related Employees and their associated receipts and expenses.

As of now, I have manually added all the details in the employee-month table and the month table, but down the line I would run a bot that would automatically add all the employee-month details when a new month begins.

Re: Iโ€™m always open to better solutions

View solution in original post

2 REPLIES 2

Well again, I figured it out after posting

What I was trying to achieve, is in a nutshell, a case of many-many relationship. While one to one, or one to many relationships can suitably be defined within one and two tables (the constituent ones), defining many to many relationships requires a third table that holds the relation definition.

  1. I created an additional month-employee table, which holds all months as many times as the number of employees, as a child of the previously mentioned โ€˜monthsโ€™ table.

  2. Within that table I used the proper select functions to generate all the financial parameters like credits and expenses.

  3. Now within the report (from the months table), I used two start expressions. One to print out all the months from a chosen financial year, defined by a slice, and within that to print out all the Related Employees and their associated receipts and expenses.

As of now, I have manually added all the details in the employee-month table and the month table, but down the line I would run a bot that would automatically add all the employee-month details when a new month begins.

Re: Iโ€™m always open to better solutions

Youโ€™re just sucking all the fun out of the community by solving your own problems. Boo!

Good job!

Top Labels in this Space