Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
To use calculated field or not?
Message
 
 
To
14/01/2012 15:40:48
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01532936
Message ID:
01532964
Views:
51
>>I agree with you about being incorrect. I have one other case where I use a calculated field in the parent table and it is never clear if the value is accurate. I also lean toward calculating on-the-fly. The only downside is that the program has to make a "trip" to calculate but given that databases are fast and computers are fast hopefully it won't be a huge issue.
>
>The speed wasn't an issue, the accuracy was. I've had the opposite case, some 22 years ago, when I stayed one long afternoon to clean it up - because I didn't keep the subtotals (of invoice, its rebate, taxes etc) in the parent record, but recalculated them. And then the sum total of invoices never matched the sales, because the subtotals were grouped differently (once by invoice, once by SKU) and then the percentages were applied at subtotal levels. The roundoff error was different, and you can't say that to an accountant. They don't care to how many decimals is it correct, it has to match.
>
>So the rule of (my sore) thumb is to calculate anything that may be used further down the road, and keep that calculated and rounded (!) value in the child record. Then, on any report you only do totals, they match, and you go home on time.

Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform