Jump to content
  • 0
Sign in to follow this  
focus54

Calculated field for running balance

Question

I'm looking for a way to add a calculated balance column on each row that contains a running balance by taking the balance value from the previous row and adding/subtracting values from current row to arrive at a new balance.

result set includes "increase" and "decrease" columns:

Increase ----- Decrease ------- Balance (calculated)

100 --------------------------- 100

400 --------------------------- 500

---------------- 200 ---------- 300

-200 --------------------------100

--------------- -300 ---------- 400

These values will be currency with 2 decimals but I think we can ignore that for now.

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Are there any newbie friendly resources that might be able to help me with something like this.

 

I'm trying to create an app that logs points, gives users the ability to redeem points and keeps a running balance based on both.

 

I have looked at JS and appears daunting.....

 

Thanks in advance.

Share this post


Link to post
Share on other sites
  • 0

Hello fozz2k,

 

Can you say a bit more about your goal?

What the data is stored in the table?

Do you want only to display Balance or save it too?

Share this post


Link to post
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...
Sign in to follow this  

×
×
  • Create New...