[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]]
==== MultiValue totals (OpenInsight Specific) ====
=== At 07 DEC 2000 05:37:25PM a becker wrote: ===
{{tag>"OpenInsight Specific"}}
We have the following situation:
in a MV table we have invoice #, Gross and net
Net is calculated by taking the discount rate (dr) which is NOT a MV field and multipling the gross.
We have a calculated total (NOT an MV) of the net so the user will know how whether they have made any entry errors on the amounts. (The bill's net amount has also been entered and is NOT an MV field.)
Problem:
The calculated net (MV) works only on the first entry of the table. The 2nd through n entrys do not calc.
The calculated net amount (NOT an MV) does not change even if you put an amount in that field. If I switch the logic to the gross (MV) amount, the calculated net amount works with each entry.
Question:
How do I get
1. the calculated net to work on entries 2-n?
2. the calculated net amount (NOT an MV) to calc the way we want?
Thanks
Andy Becker
Illinois State Lottery
----
=== At 08 DEC 2000 07:22AM Oystein Reigem wrote: ===
Andy,
You must send a CALCULATE event to your net total control to get it to update. E.g, if your net total control is NET_TOTAL, you must do
Ret=Send_Event( @Window : ".NET_TOTAL", "CALCULATE" )
E.g, do this on the POSCHANGED and LOSTFOCUS events of your edit table.
(Btw - if you ever need to update a symbolic in an edit table you must use one more parameter. E.g to update column 2 of edit table ET, do
Ret=Send_Event( @Window : ".ET", "CALCULATE", 2 )
)
- Oystein -
----
=== At 08 DEC 2000 07:26AM Joe Doscher wrote: ===
a becker
Check your event handlers and made sure they are NOT retunn 0 zero.
Hope this helps
----
=== At 08 DEC 2000 10:09AM a becker wrote: ===
Thanks
We thought it had to be something simple that we didn't know about.
Andy
----
=== At 08 DEC 2000 10:11AM a becker wrote: ===
Thanks for your input. See Oystein's response also.
----
=== At 08 DEC 2000 10:48AM Oystein Reigem wrote: ===
Andy,
It seems it's not always necessary. Like, in your form it seems to work without CALCULATE the first time. But it's a good idea to always do it.
- Oystein -
----
=== At 08 DEC 2000 01:23PM a becker wrote: ===
Oystein -
I tried it, but no luck. I put both the send_events in the POSCHANGED and LOSTFOCUS and it still doesn't calculate either the summation total or the individual row column.
Any ideas?
----
=== At 08 DEC 2000 02:38PM Don Miller wrote: ===
Andy ..
Is the "Net" in the table a SYMBOLIC? Is it the case that you do something like:
A1={GROSS} ;* FORCE A DICT RECALC
D1={DISC_PCT} ;* THIS SHOULD BE OK IF IT'S BOUND IN FORM
NET="
K1=COUNT(A1,@VM)+(K1 # "")
FOR I=1 TO K1
GA=GROSS
IF D1 THEN
NET=GA*D1/10000 ;* OR WHATEVER SCALING YOU HAVE TO USE
END ELSE
NET=GA
END
NEXT I
@ANS=NET
Then you ought to be able to do do a RECALC to make it show
The cumulative running totals for TOT_NET ought to be @ANS=SUM(this_field). I have a virtually identical cash receipts screen that takes the current AP balance, subtracts the cash$ applied, subtracts the discount$ taken and displays a new balance for the AP item. At the bottom of the table, running totals are maintained for the cash$ and the discount$. The sum of these two totals is the AP offset being taken.
HTH
Don Miller
C3 Inc.
----
=== At 08 DEC 2000 05:34PM Oystein Reigem wrote: ===
Andy,
Perhaps the formula is wrong. Perhaps you sum just the first multivalue.
What happens if you fill in the second value first? And then the first one.
- Oystein -
----
=== At 11 DEC 2000 12:30PM a becker wrote: ===
Don
I have put your coding in the table building with the appropriate changes for the record and it still does not calc. The record has two entries, the first entry calculates, the 2nd does not.
I have a send_event to recalc both the MV symbolic net amt and the cummulative running totals in both the POSCHANGE and LOSTFOCUS events in the window for the table.
Do I have something in the wrong area?
Andy
[[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=12AF47FBDFB48E02852569AE007C46C1|View this thread on the forum...]]