totc()
George Ziemann
gzieman54 at gmail.com
Fri Dec 12 14:07:40 EST 2014
Daniel,
(InvType='F'&(InvAmount>=0&InvTotal>=0)) is either going to evaluate as 1
(kTrue) or 0 (kFalse).
So your totc() calculation is going to multiply InvAmount by either 1 (if
all the conditions are true) or 0 (if even one of them is false) before
adding them to Amount. The totc() calculation ignores any list lines which
have a negative InvAmount, a negative InvTotal or if the InvType is
anything other than "F".
The point of the totc() calculation seems to be to to give you an Amount
which ignores any credit invoices (which would have a negative total and
would lower the Amount) and to only provide a total for invoice where
InvType = F.
Calculate Amount as tot(InvAmount) gives you the total of InvAmount for the
list.
If you're getting the same result using tot() and totc(), that's because
every invoice in the list passed all the tests.
If you change the InvType for one of the invoices on the list — or if one
of the invoices has a credit and shows a negative total — then the tot()
and totc() calculations will give different results.
On Fri, Dec 12, 2014 at 11:06 AM, Daniel Sananes <danielsananes at hotmail.com>
wrote:
>
> 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
>
--
George Ziemann
(480) 278-9746
More information about the omnisdev-en
mailing list