Calculated field for running tally

Discussions for the HanDBase for iPad and it's conduits and desktop add-ons

Calculated field for running tally

Postby chuxtable » Fri Nov 14, 2014 8:30 am

Hi, I am trying to use the calculated field to have a running tally in a database. Each record in my database has field ( also calculated) with a number, either whole or decimal, of 0.1, 0.3, 1.0 or 3.0. I have another field in which have a running total of these values, eg record 1 has the value of 3.0,running total=3.0; record 2 has the value of 1.0, running total=4.0; record 3 has value of 0.3, running total=4.3, etc. This is not working however, as when I get to record 3, the site tally shows 1.3, instead of 4.3. Another example is if I enter 4 records, each with a value of 3.0 (running tally should=12), it calcultes the first 2 records OK (running tally=6.0), but 3rd and 4th records the running tally remains at 6.0. My formula for the tally ield is PrevTally+Tally. Not sure what the problem is. Can anyone help?
chuxtable
 
Posts: 67
Joined: Tue Mar 27, 2012 10:16 pm

Re: Calculated field for running tally

Postby curtterp » Fri Nov 14, 2014 10:17 am

chuxtable wrote:Hi, I am trying to use the calculated field to have a running tally in a database. Each record in my database has field ( also calculated) with a number, either whole or decimal, of 0.1, 0.3, 1.0 or 3.0. I have another field in which have a running total of these values, eg record 1 has the value of 3.0,running total=3.0; record 2 has the value of 1.0, running total=4.0; record 3 has value of 0.3, running total=4.3, etc. This is not working however, as when I get to record 3, the site tally shows 1.3, instead of 4.3. Another example is if I enter 4 records, each with a value of 3.0 (running tally should=12), it calcultes the first 2 records OK (running tally=6.0), but 3rd and 4th records the running tally remains at 6.0. My formula for the tally ield is PrevTally+Tally. Not sure what the problem is. Can anyone help?



The error is in your calculation formula

If you want a running total, you need to use the formula (Previous Running Tally + Tally).

Your formula (Previous Tally + Tally) only adds the two tally's next to each other. You can see this behavior by changing the tally fields of the 4 test fields to 1, 2, 3, 4.

The first running tally will show 1 (1+0) (There is no previous tally)
The second running tally will show 3 (1+2) (records 1 and 2)
The third running tally will show 5 (2+3) (records 2 and 3)
The fourth tally will show 7 (3+4) (records 3 and 4)
Have a good day

Curt
I am not a DDHSoftware employee, just a long time HanDBase user.... from Palm to Windows Mobile to Android, to iOS. Thanks to DDH, the database files transferred to each platform without a problem.
curtterp
 
Posts: 679
Joined: Tue May 26, 2009 6:41 pm
Location: Northern IL

Re: Calculated field for running tally

Postby chuxtable » Sat Nov 15, 2014 12:14 am

Great, that solved my problem! Thanks Curt
chuxtable
 
Posts: 67
Joined: Tue Mar 27, 2012 10:16 pm


Return to HanDBase for iPad

Who is online

Users browsing this forum: No registered users and 1 guest

cron