totc()

Gary Connor gary_connor at directline-tech.com
Fri Dec 12 13:56:13 EST 2014


The "tot" simply totals the lines.  The "totc" totals calculations based on
line contents, so:

tot(InvAmount) will total the column containing InvAmount, including
negatives and nulls.

totc((InvAmount)*(InvType='F'&(InvAmount>=0&InvTotal>=0))) will only total
InvAmount IF the INVType is 'F' AND is both the InvAmount and INVTotal are
positive numbers.

The second calculation will give the same result as the first as long as
EVERY line contains InvType 'F' AND EVERY line has a zero or greater
InvAmount AND InvTotal.  The totc is actually (in this case) filtering based
on InvType, InvAmount, and InvTotal.  InvTypes that are NOT InvType 'F'
would be excluded as would any line where InvAmount or InvTotal was a
negative number.

I don't know if I just made things better or worse...


Gary Connor, Ph.D., CIO
DirectLine Technologies, Inc.
1600 N Carpenter Rd  Ste D
Modesto, CA 95351



|-----Original Message-----
|From: omnisdev-en-bounces at lists.omnis-dev.com [mailto:omnisdev-en-
|bounces at lists.omnis-dev.com] On Behalf Of Daniel Sananes
|Sent: Friday, December 12, 2014 10:06 AM
|To: 'OmnisDev List - English'
|Subject: totc()
|
|Hi again,
|
|
|
|Wonder if someone can explain why these two present the same result. I just
|copied these from codes in an omnis7-application.
|
|I do not understand how the longer totc()-expression understands itself.
|
|Calculate Amount as
|totc((InvAmount)*(InvType='F'&(InvAmount>=0&InvTotal>=0)))
|
|Calculate Amount as tot(InvAmount)
|
|Does the (InvType='F'&(InvAmount>=0&InvTotal>=0))-expression really
|selects
|the correct lines. Obviously it does. But how?
|
|And how does InvAmount multiplied by the expression work. I don't
|understand
|the logic.
|
|
|
|The second calculation is from a list which was merged with
|InvType='F'&InvAmount>=0&InvTotal>=0 for testing the correctness of it all.
|
|
|
|Hope someone has the good heart to lecture me!
|
|
|
|Regards
|
|Daniel
|
|
|
|
|
|___________________________________________________________
|__
|Manage your list subscriptions at http://lists.omnis-dev.com


More information about the omnisdev-en mailing list