Jump to content
  • 0

Question about calculation


Aleksandra
 Share

Question

Hello,

Does anyone know what would be the best way to calculate the remaining budget? For example, I have a fixed budget of $10,000 for project A and $15,000 for project B, and so on. When I add expenses related to a particular project, I want to see how much money is left but I am stuck with the calculation formula. The budget is stored in the Projects table and expenses are stored in the Expenses table.

Thank you all in advance

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

This should be quite easy using a calculated field in your page. What kind of datapage are you using to display the data?

You can either use a view of both tables or just call the other value over using a select statement if you only have one table as the source. 

 

If you want the calculation to be saved to the table, I'm not too sure of another way other than Triggers. However, I have heard somewhere that triggers aren't the best to use for mathematical purposes. I'd give it a try and see if it works for you, though.

Link to comment
Share on other sites

  • 0

Thank you for your response @kpcollier. I tried that approach before, but the issue is that it doesn't update the Project budget field I've created in the Expenses table (it pulls records from the Projects table so I don't have to use that table for this formula, it can be done with Expenses table). So, for example, I have project A with a budget of $10,000. I add project expenses of $1,000 so my remaining budget now is $9,000. If I want to add another project expense of $2,000, it shows me that my remaining budget now is $8,000 and it should be $7,000. 

So, I was thinking maybe it would be better to create a calculation field that will accumulate all expenses related to the specific project and then have a formula [Project_Budget]-[Total_Expenses] for the field Budget Remaining.

Link to comment
Share on other sites

  • 0

Hi @Aleksandra,

I agree with previous comments from kpcollier and sandy159.

The approach depends on the expected result.

1) If you need to store the updated budget  in the Projects table and store the initial budget as well, you may add a new field to the Projects table. 

This field can be updated by the Triggered Action. If the only action is to subtract the expenses, the Trigger is rather simple.

2) If you do not need to store the updated budget, you may use the Calculated field to calculate the result and just display it. 
In this case the article shared by sandy159 can be helpful. However, the solution described there involves 1 table, so for your case it should modified.


If you need further assistance, any screenshot of the current result will be helpful.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...